mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 09:10:35 +08:00
Handle badfilter syntax correctly
This commit is contained in:
parent
9ca81d4ab7
commit
138245154d
@ -10,7 +10,7 @@ const threads = Math.max(require('os').cpus().length, 12);
|
||||
|
||||
// Parse from remote hosts & domain lists
|
||||
(await Promise.all([
|
||||
// processHosts('https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext', true),
|
||||
processHosts('https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext', true),
|
||||
processHosts('https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt'),
|
||||
processHosts('https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt')
|
||||
])).forEach(hosts => {
|
||||
|
||||
@ -97,7 +97,12 @@ async function processFilterRules(filterRulesUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (line.startsWith('@@||')
|
||||
if (line.startsWith('||') && line.endsWith('^$badfilter')) {
|
||||
const domain = line.replaceAll('||', '').replaceAll('^$badfilter', '').trim();
|
||||
if (rDomain.test(domain)) {
|
||||
whitelistDomainSets.add(domain);
|
||||
}
|
||||
} else if (line.startsWith('@@||')
|
||||
&& (
|
||||
line.endsWith('^')
|
||||
|| line.endsWith('^|')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user