diff --git a/src/assets/manifest.json b/src/assets/manifest.json index f6a7a9a..5767d65 100644 --- a/src/assets/manifest.json +++ b/src/assets/manifest.json @@ -36,6 +36,7 @@ "storage", "notifications", "alarms", - "idle" + "idle", + "unlimitedStorage" ] } diff --git a/src/js/background/utils.js b/src/js/background/utils.js index 601b5d7..b000ec0 100644 --- a/src/js/background/utils.js +++ b/src/js/background/utils.js @@ -45,11 +45,13 @@ chrome.alarms.onAlarm.addListener((alarm) => { } }); -chrome.idle.onStateChanged.addListener((newState) => { - if (newState === 'active') { - initSchedule(); - } -}); +if ('idle' in chrome) { + chrome.idle.onStateChanged.addListener((newState) => { + if (newState === 'active') { + initSchedule(); + } + }); +} getConfig((conf) => { config = conf; diff --git a/src/js/common/config.js b/src/js/common/config.js index b8ae2fd..038fa22 100644 --- a/src/js/common/config.js +++ b/src/js/common/config.js @@ -26,7 +26,7 @@ export const defaultConfig = { local: false, }, refreshTimeout: 5 * 60 * 60, - enableRemoteRules: !navigator.userAgent.match(/firefox/i), + enableRemoteRules: !navigator.userAgent.match(/firefox|safari/i), }; export function getConfig(success) { diff --git a/src/js/common/radar-rules.js b/src/js/common/radar-rules.js index 56609d8..f871b14 100644 --- a/src/js/common/radar-rules.js +++ b/src/js/common/radar-rules.js @@ -1,4 +1,4 @@ -({ +export const defaultRules = { '8world.com': { _name: '8视界', '.': [{ title: '分类', docs: 'https://docs.rsshub.app/new-media.html#_8-shi-jie-fen-lei', source: ['/:category', '/'], target: '/8world/:category?' }] }, 'aamacau.com': { _name: '論盡媒體 AllAboutMacau Media', '.': [{ title: '话题', docs: 'https://docs.rsshub.app/new-media.html#lun-jin-mei-ti-allaboutmacau-media-hua-ti', source: ['/'], target: '/:category?/:id?' }] }, 'eprice.com.tw': { _name: 'ePrice', '.': [{ title: 'ePrice 比價王', docs: 'https://docs.rsshub.app/new-media.html#eprice', source: ['/'], target: '/:region?' }] }, @@ -1327,4 +1327,4 @@ }, 'macwk.com': { _name: 'MacWk', '.': [{ title: '应用更新', docs: 'https://docs.rsshub.app/program-update.html#macwk', source: '/soft/:name', target: '/macwk/soft/:name' }] }, 'zyshow.net': { www: [{ title: '', docs: 'https://docs.rsshub.app/game.html#lv-fa-shi-ying-di', source: '/:name/', target: '/zyshow/:name' }] }, -}); +}; diff --git a/src/js/common/rules.js b/src/js/common/rules.js index a85dd67..44d849d 100644 --- a/src/js/common/rules.js +++ b/src/js/common/rules.js @@ -1,5 +1,5 @@ import { defaultConfig } from './config'; -import defaultRules from './radar-rules'; +import { defaultRules } from './radar-rules'; export function refreshRules(success) { if (defaultConfig.enableRemoteRules) {