瀏覽代碼

inject directly *-web.js files (cli)

Gildas 5 年之前
父節點
當前提交
08fc48524c

+ 3 - 1
cli/back-ends/common/scripts.js

@@ -25,9 +25,11 @@
 
 const fs = require("fs");
 
-const SCRIPTS = [
+const SCRIPTS = [		
 	"lib/single-file/processors/hooks/content/content-hooks.js",
+	"lib/single-file/processors/hooks/content/content-hooks-web.js",
 	"lib/single-file/processors/hooks/content/content-hooks-frames.js",
+	"lib/single-file/processors/hooks/content/content-hooks-frames-web.js",
 	"lib/single-file/processors/frame-tree/content/content-frame-tree.js",
 	"lib/single-file/processors/lazy/content/content-lazy-loader.js",
 	"lib/single-file/single-file-util.js",

+ 0 - 5
lib/single-file/processors/hooks/content/content-hooks-frames.js

@@ -66,11 +66,6 @@ this.singlefile.lib.processors.hooks.content.frames = this.singlefile.lib.proces
 			scriptElement.async = false;
 			(document.documentElement || document).appendChild(scriptElement);
 			scriptElement.remove();
-		} else if (this.singlefile.lib.getFileContent) {
-			const scriptElement = document.createElement("script");
-			scriptElement.textContent = this.singlefile.lib.getFileContent("/lib/single-file/processors/hooks/content/content-hooks-frames-web.js");
-			(document.documentElement || document).appendChild(scriptElement);
-			scriptElement.remove();
 		}
 	}
 

+ 0 - 2
lib/single-file/processors/hooks/content/content-hooks.js

@@ -35,8 +35,6 @@ this.singlefile.lib.processors.hooks.content.main = this.singlefile.lib.processo
 		if (browser && browser.runtime && browser.runtime.getURL) {
 			scriptElement.src = browser.runtime.getURL("/lib/single-file/processors/hooks/content/content-hooks-web.js");
 			scriptElement.async = false;
-		} else if (this.singlefile.lib.getFileContent) {
-			scriptElement.textContent = this.singlefile.lib.getFileContent("/lib/single-file/processors/hooks/content/content-hooks-web.js");
 		}
 		(document.documentElement || document).appendChild(scriptElement);
 		scriptElement.remove();