Handle badfilter syntax correctly

This commit is contained in:
SukkaW
2022-05-13 14:19:23 +08:00
parent 9ca81d4ab7
commit 138245154d
2 changed files with 7 additions and 2 deletions

View File

@@ -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('^|')