fix: Compatibility before chrome116 (#1034)

Co-authored-by: cbingb666 <cbingb666@163.com>
This commit is contained in:
cbingb666 2024-06-13 23:07:43 +08:00 committed by GitHub
parent 97d7470201
commit 9b94332b22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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",

View File

@ -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",