fix: use json type rules for eval disabled browser

This commit is contained in:
DIYgod 2024-01-30 21:14:52 +08:00
parent 9e37bb9dd9
commit 9f139e0f03
No known key found for this signature in database
1 changed files with 5 additions and 8 deletions

View File

@ -4,6 +4,9 @@ import toast from "react-hot-toast"
const storage = new Storage()
const enableFullRemoteRules = !(navigator.userAgent.match(/firefox/i) || (navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/chrome/i)))
const remoteRulesUrl = enableFullRemoteRules ? 'https://rsshub.js.org/build/radar-rules.js' : 'https://rsshub.js.org/build/radar-rules.json'
export const defaultConfig = {
rsshubDomain: 'https://rsshub.app',
rsshubAccessControl: {
@ -35,14 +38,8 @@ export const defaultConfig = {
local: true,
},
refreshTimeout: 2 * 60 * 60,
// typical UA:
// Firefox: Mozilla/5.0 (X11; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0
// Chromium/Chrome: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Safari/537.36
// Some Chromium: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/80.0.3987.87 Chrome/80.0.3987.87 Safari/537.36
// Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 12_3_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15
// Edge: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36 Edg/99.0.1150.36
enableFullRemoteRules: !(navigator.userAgent.match(/firefox/i) || (navigator.userAgent.match(/safari/i) && !navigator.userAgent.match(/chrome/i))),
remoteRulesUrl: 'https://rsshub.js.org/build/radar-rules.js',
enableFullRemoteRules,
remoteRulesUrl,
};
export async function getConfig() {