Skip to content

Commit

Permalink
fix: use json type rules for eval disabled browser
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jan 30, 2024
1 parent 9e37bb9 commit 9f139e0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 9f139e0

Please sign in to comment.