diff --git a/core_injection.js b/core_injection.js index 720b9d0..289e931 100644 --- a/core_injection.js +++ b/core_injection.js @@ -2,7 +2,7 @@ inject(); async function inject() { - await addScript('core/WebScoketInterception.js'); + await addScriptInstantly('core/WebScoketInterception.js'); await addScript('core/BinaryReader.js'); await addScript('core/WAPacket.js'); await addScript('core/Crypto.js'); @@ -14,6 +14,21 @@ async function inject() await addScript('core/Main.js'); } +async function addScriptInstantly(scriptName) +{ + fetch(chrome.extension.getURL(scriptName)) + .then((response) => + { + response.body.getReader().read().then((text) => + { + var s = document.createElement('script'); + s.textContent = new TextDecoder("utf-8").decode(text.value); + (document.head||document.documentElement).appendChild(s); + }); + }); +} + + function addScript(scriptName) { return new Promise(function(resolve, reject) { var s = document.createElement('script'); diff --git a/manifest.json b/manifest.json index 03e5354..2d4b31e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "name": "WAIncognito", "short_name": "WhatsIncognito", "description": "Be invisible on WhatsApp™ Web by disabling read receipts and presence updates", - "version": "1.4.5", + "version": "1.4.6", "permissions": [ ], "icons": {