Skip to content

Commit

Permalink
fix: Compatibility before chrome116 (#1034)
Browse files Browse the repository at this point in the history
Co-authored-by: cbingb666 <cbingb666@163.com>
  • Loading branch information
cbingb666 and cbingb666 authored Jun 13, 2024
1 parent 97d7470 commit 9b94332
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/background/rss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/background/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9b94332

Please sign in to comment.