diff --git a/src/background/rss.ts b/src/background/rss.ts index c932d22..d373665 100644 --- a/src/background/rss.ts +++ b/src/background/rss.ts @@ -44,7 +44,7 @@ export const getRSS = async (tabId, url) => { tabId, }) - if (chrome.offscreen) { + if (chrome.offscreen && chrome.runtime.getContexts) { await setupOffscreenDocument("tabs/offscreen.html") chrome.runtime.sendMessage({ target: "offscreen", diff --git a/src/background/rules.ts b/src/background/rules.ts index c790926..1baa8c8 100644 --- a/src/background/rules.ts +++ b/src/background/rules.ts @@ -12,7 +12,7 @@ const storage = new Storage({ export const refreshRules = async () => { const rules = await getRemoteRules() await storage.set("rules", rules) - if (chrome.offscreen) { + if (chrome.offscreen && chrome.runtime.getContexts) { await setupOffscreenDocument("tabs/offscreen.html") chrome.runtime.sendMessage({ target: "offscreen",