实现safari extension功能,但是不能更新规则 (#678)

This commit is contained in:
EdwardGao
2022-02-14 00:14:50 +00:00
committed by GitHub
parent d9d7d6ba61
commit 31e449ae65
5 changed files with 13 additions and 10 deletions
+2 -1
View File
@@ -36,6 +36,7 @@
"storage",
"notifications",
"alarms",
"idle"
"idle",
"unlimitedStorage"
]
}
+7 -5
View File
@@ -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;
+1 -1
View File
@@ -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) {
+2 -2
View File
@@ -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' }] },
});
};
+1 -1
View File
@@ -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) {