aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/background.ts
diff options
context:
space:
mode:
authorAjay <[email protected]>2023-08-14 09:28:56 -0400
committerAjay <[email protected]>2023-08-14 09:28:56 -0400
commitd8cc93c841a0cb23d1ed10f36b6b5cc87aae71b7 (patch)
tree6de33706fd21297d3a7b48b3a970cd702c9e1538 /src/background.ts
parent3dde05eda2f8135ead52504f6384bdff29328819 (diff)
downloadSponsorBlock-d8cc93c841a0cb23d1ed10f36b6b5cc87aae71b7.tar.gz
SponsorBlock-d8cc93c841a0cb23d1ed10f36b6b5cc87aae71b7.zip
Fix for Firefox not offering promise based APIs in mv2
Diffstat (limited to 'src/background.ts')
-rw-r--r--src/background.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/background.ts b/src/background.ts
index 10e98354..ac3847e9 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -16,6 +16,7 @@ import { getExtensionIdsToImportFrom } from "./utils/crossExtension";
import { isFirefoxOrSafari } from "../maze-utils/src";
import { injectUpdatedScripts } from "../maze-utils/src/cleanup";
import { logWarn } from "./utils/logger";
+import { chromeP } from "../maze-utils/src/browserApi";
const utils = new Utils({
registerFirefoxContentScript,
unregisterFirefoxContentScript
@@ -177,7 +178,7 @@ async function registerFirefoxContentScript(options: Registration) {
await unregisterFirefoxContentScript(options.id);
if ("scripting" in chrome && "getRegisteredContentScripts" in chrome.scripting) {
- await chrome.scripting.registerContentScripts([{
+ await chromeP.scripting.registerContentScripts([{
id: options.id,
runAt: "document_start",
matches: options.matches,
@@ -203,7 +204,7 @@ async function registerFirefoxContentScript(options: Registration) {
*/
async function unregisterFirefoxContentScript(id: string) {
if ("scripting" in chrome && "getRegisteredContentScripts" in chrome.scripting) {
- await chrome.scripting.unregisterContentScripts({
+ await chromeP.scripting.unregisterContentScripts({
ids: [id]
});
} else {