PUGE 3 年之前
父节点
当前提交
caac3bb864
共有 4 个文件被更改,包括 18 次插入146 次删除
  1. 7 0
      back/insert.js
  2. 0 133
      background.js
  3. 0 0
      insert.js
  4. 11 13
      manifest.json

+ 7 - 0
back/insert.js

@@ -6,6 +6,13 @@ const serverUrl = 'https://going.run/assistAll'
 
 
 function addScr (data) {
+  if (!document.body) {
+    setTimeout(() => {
+      console.info('尝试重新加载:' + data)
+      addScr (data)
+    }, 100);
+    return
+  }
   var script = document.createElement("script");
   script.type = "text/javascript";
   script.charset = "UTF-8";

文件差异内容过多而无法显示
+ 0 - 133
background.js


文件差异内容过多而无法显示
+ 0 - 0
insert.js


+ 11 - 13
manifest.json

@@ -1,20 +1,21 @@
 {
-	"manifest_version": 3,
+	"manifest_version": 2,
 	"name": "脚本助手",
-	"version": "1.1.18",
+	"version": "1.1.19",
 	"description": "脚本助手",
 	"icons": {
 		"16": "./img/16.png",
 		"48": "./img/48.png",
 		"128": "./img/128.png"
 	},
-	"action":  {
+	"browser_action":  {
 		"default_icon": "img/48.png",
 		"default_title": "脚本助手",
 		"default_popup": "popup.html"
 	},
 	"background": {
-		"service_worker": "background.js"
+		"persistent": true,
+		"scripts": ["background.js"]
 	},
 	"content_scripts": [
 		{
@@ -29,18 +30,15 @@
 		"background",
 		"activeTab",
 		"webRequest",
-		"declarativeNetRequest",
-		"notifications"
-	],
-	"optional_host_permissions": [
-		"*://*/*"
-	],
-	"host_permissions": [
-		"*://*/*"
+		"webRequestBlocking",
+		"notifications",
+		"http://*/*",
+  		"https://*/*"
 	],
 	"homepage_url": "https://github.com/PUGE",
 	"options_page": "options.html",
 	"options_ui": {
-		"page": "options.html"
+		"page": "options.html",
+		"chrome_style": true
 	}
 }

部分文件因为文件数量过多而无法显示