zhangwei 3 роки тому
батько
коміт
889822b8e3
4 змінених файлів з 21 додано та 4 видалено
  1. 7 1
      src/entry/content.js
  2. 12 1
      src/manifest.development.json
  3. 1 1
      src/view/options.vue
  4. 1 1
      src/view/test.vue

+ 7 - 1
src/entry/content.js

@@ -1 +1,7 @@
-console.log('123 world content todo something~')
+console.log('123 world content todo something~')
+
+let iframe = document.createElement('iframe')
+
+
+iframe.src = chrome.runtime.getURL('/iframe/test.html')
+document.body.appendChild(iframe)

+ 12 - 1
src/manifest.development.json

@@ -19,5 +19,16 @@
             ]
         }
     ],
-    "options_page": "options.html"
+    "options_page": "options.html",
+    "web_accessible_resources": [
+        {
+          "resources": [
+            "/iframe/test.html"
+          ],
+          "matches": [
+            "<all_urls>"
+          ]
+        }
+        
+    ]
 }

+ 1 - 1
src/view/options.vue

@@ -9,7 +9,7 @@ export default {
   name: 'optionsView',
   data () {
     return {
-      msg: 'options'
+      msg: 'options123'
     }
   }
 }

+ 1 - 1
src/view/test.vue

@@ -9,7 +9,7 @@ export default {
   name: 'optionsView',
   data () {
     return {
-      msg: 'options'
+      msg: 'iframe12'
     }
   }
 }