Ver código fonte

removed obsolete code

Gildas 7 anos atrás
pai
commit
ada92dd12e
1 arquivos alterados com 2 adições e 7 exclusões
  1. 2 7
      extension/core/bg/core.js

+ 2 - 7
extension/core/bg/core.js

@@ -92,8 +92,8 @@ singlefile.core = (() => {
 						}
 					}
 					try {
-						const code = await getContentScript(mergedOptions);
-						await browser.tabs.executeScript(tab.id, { code, allFrames: false, runAt: "document_idle" });
+						await initScripts();
+						await browser.tabs.executeScript(tab.id, { code: modulesScript + "\n" + contentScript, allFrames: false, runAt: "document_idle" });
 						scriptsInjected = true;
 					} catch (error) {
 						// ignored
@@ -126,11 +126,6 @@ singlefile.core = (() => {
 		}
 	}
 
-	async function getContentScript() {
-		await initScripts();
-		return modulesScript + "\n" + contentScript;
-	}
-
 	async function getScript(scriptFiles) {
 		const scriptsPromises = scriptFiles.map(async scriptFile => {
 			if (typeof scriptFile == "function") {