diff options
author | Ajay <[email protected]> | 2023-08-25 16:01:11 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2023-08-25 16:01:11 -0400 |
commit | 3b06d722709bbd3632865122a1ab460d3df34aab (patch) | |
tree | f0c1dbb59871afae839c75e64be29603fe0c290b /src/background.ts | |
parent | 4bd055646491a0a3e2f2abf74c7a9326b40dc5fe (diff) | |
download | SponsorBlock-3b06d722709bbd3632865122a1ab460d3df34aab.tar.gz SponsorBlock-3b06d722709bbd3632865122a1ab460d3df34aab.zip |
Fix invidious support of Firefox
Diffstat (limited to 'src/background.ts')
-rw-r--r-- | src/background.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/background.ts b/src/background.ts index ac3847e9..e8afa0a1 100644 --- a/src/background.ts +++ b/src/background.ts @@ -204,9 +204,13 @@ async function registerFirefoxContentScript(options: Registration) { */ async function unregisterFirefoxContentScript(id: string) { if ("scripting" in chrome && "getRegisteredContentScripts" in chrome.scripting) { - await chromeP.scripting.unregisterContentScripts({ - ids: [id] - }); + try { + await chromeP.scripting.unregisterContentScripts({ + ids: [id] + }); + } catch (e) { + // Already registered + } } else { if (contentScriptRegistrations[id]) { contentScriptRegistrations[id].unregister(); |