Feat: reject supports $all syntax

This commit is contained in:
SukkaW
2022-04-22 05:49:10 +08:00
parent 7ba16b0a55
commit 631b2806cf
2 changed files with 8 additions and 1 deletions

View File

@@ -120,9 +120,15 @@ async function processFilterRules(filterRulesUrl) {
&& (
line.endsWith('^')
|| line.endsWith('^|')
|| line.endsWith('^$all')
)
) {
const domain = `${line.replaceAll('||', '').replaceAll('^|', '').replaceAll('^', '')}`.trim();
const domain = line
.replaceAll('||', '')
.replaceAll('^|', '')
.replaceAll('^$all', '')
.replaceAll('^', '')
.trim();
if (rDomain.test(domain)) {
blacklistDomainSets.add(`.${domain}`);
}