mirror of
https://github.com/SukkaW/Surge.git
synced 2026-01-29 01:51:52 +08:00
Handle badfilter syntax correctly
This commit is contained in:
@@ -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('^|')
|
||||
|
||||
Reference in New Issue
Block a user