Browse Source

[add][icons-config]

zhangwei 3 years ago
parent
commit
3a1202891c

BIN
src/assets/logo/icon-16.png


BIN
src/assets/logo/icon-24.png


BIN
src/assets/logo/icon-32.png


+ 16 - 12
src/manifest.development.json

@@ -7,7 +7,12 @@
         "service_worker": "/js/background.js"
     },
     "action": {
-        "default_popup": "popup.html"
+        "default_popup": "popup.html",
+        "default_icon": {              // optional
+            "16": "/logo/icon-16.png",   // optional
+            "24": "/logo/icon-24.png",   // optional
+            "32": "/logo/icon-32.png"    // optional
+          }
     },
     "content_scripts": [
         {
@@ -23,8 +28,8 @@
     "host_permissions": [
         "*://*/*",
         "https://de-net-test.piaoquantv.com"
-      ],
-    "permissions":[
+    ],
+    "permissions": [
         "tabs",
         "action",
         "cookies",
@@ -37,14 +42,13 @@
     "options_page": "options.html",
     "web_accessible_resources": [
         {
-          "resources": [
-            "/iframe/publish.html",
-            "/iframe/red-packet.html"
-          ],
-          "matches": [
-            "<all_urls>"
-          ]
+            "resources": [
+                "/iframe/publish.html",
+                "/iframe/red-packet.html"
+            ],
+            "matches": [
+                "<all_urls>"
+            ]
         }
-
     ]
-}
+}

+ 11 - 0
vue.config.js

@@ -14,6 +14,17 @@ function getEntryFile (entryPath) {
   return files
 }
 
+const logoName = getEntryFile(path.resolve(`src/assets/logo`))
+logoName.forEach((name) => {
+  const fileExtension = getFileExtension(name)
+  const fileName = name.replace('.' + fileExtension, '')
+  console.log(name)
+  pages[fileName] = {
+    entry: `src/assets/logo/${name}`,
+    filename: `logo/${name}`
+  }
+})
+
 const chromeName = getEntryFile(path.resolve(`src/entry`))
 
 const iframeName = getEntryFile(path.resolve(`src/iframe`))