diff --git a/src/content_scripts/main.js b/src/content_scripts/main.js index d6c8ee1f1..8ec8a6a1b 100644 --- a/src/content_scripts/main.js +++ b/src/content_scripts/main.js @@ -76,20 +76,9 @@ return installedScripts; }; - const initMainWorld = () => { - const { nonce } = [...document.scripts].find(script => script.getAttributeNames().includes('nonce')); - const script = document.createElement('script'); - script.type = 'module'; - script.nonce = nonce; - script.src = browser.runtime.getURL('/main_world/index.js'); - document.documentElement.append(script); - }; - const init = async function () { $('style.xkit').remove(); - initMainWorld(); - browser.storage.onChanged.addListener(onStorageChanged); const installedScripts = await getInstalledScripts(); diff --git a/src/manifest.json b/src/manifest.json index 8d85a15cf..1c260462c 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -40,6 +40,22 @@ "matches": [ "*://www.tumblr.com/*" ] }], "content_scripts": [ + { + "matches": [ + "*://www.tumblr.com/*" + ], + "exclude_matches": [ + "*://www.tumblr.com/login", + "*://www.tumblr.com/register", + "*://www.tumblr.com/register?*", + "*://www.tumblr.com/privacy/*" + ], + "run_at": "document_end", + "js": [ + "main_world/index.js" + ], + "world": "MAIN" + }, { "matches": [ "*://www.tumblr.com/*" @@ -71,10 +87,10 @@ "browser_specific_settings": { "gecko": { "id": "{6e710c58-36cc-49d6-b772-bfc3030fa56e}", - "strict_min_version": "121.0" + "strict_min_version": "128.0" }, "gecko_android": { - "strict_min_version": "121.0" + "strict_min_version": "128.0" } } }