实现safari extension功能,但是不能更新规则 (#678)
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
"storage",
|
||||
"notifications",
|
||||
"alarms",
|
||||
"idle"
|
||||
"idle",
|
||||
"unlimitedStorage"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,5 +1,5 @@
|
||||
import { defaultConfig } from './config';
|
||||
import defaultRules from './radar-rules';
|
||||
import { defaultRules } from './radar-rules';
|
||||
|
||||
export function refreshRules(success) {
|
||||
if (defaultConfig.enableRemoteRules) {
|
||||
|
||||
Reference in New Issue
Block a user