Fix invidious support of Firefox

This commit is contained in:
Ajay
2023-08-25 16:01:11 -04:00
parent 4bd0556464
commit 3b06d72270

View File

@@ -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();