Skip to content

Commit 3b06d72

Browse files
committed
Fix invidious support of Firefox
1 parent 4bd0556 commit 3b06d72

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/background.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ async function registerFirefoxContentScript(options: Registration) {
204204
*/
205205
async function unregisterFirefoxContentScript(id: string) {
206206
if ("scripting" in chrome && "getRegisteredContentScripts" in chrome.scripting) {
207-
await chromeP.scripting.unregisterContentScripts({
208-
ids: [id]
209-
});
207+
try {
208+
await chromeP.scripting.unregisterContentScripts({
209+
ids: [id]
210+
});
211+
} catch (e) {
212+
// Already registered
213+
}
210214
} else {
211215
if (contentScriptRegistrations[id]) {
212216
contentScriptRegistrations[id].unregister();

0 commit comments

Comments
 (0)