mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Refactor: disable adguardhome append whitelist
This commit is contained in:
parent
ea6a4a0dc3
commit
6bc65c4088
@ -164,7 +164,7 @@ export const buildRejectDomainSet = task(require.main === module, __filename)(as
|
||||
'! Description: The domainset supports AD blocking, tracking protection, privacy protection, anti-phishing, anti-mining',
|
||||
'!'
|
||||
],
|
||||
rejectOutput.adguardhome(filterRuleWhitelistDomainSets)
|
||||
rejectOutput.adguardhome(/* filterRuleWhitelistDomainSets */)
|
||||
),
|
||||
path.join(OUTPUT_INTERNAL_DIR, 'reject-adguardhome.txt')
|
||||
)
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { invariant } from 'foxact/invariant';
|
||||
import createKeywordFilter from '../aho-corasick';
|
||||
import { sortDomains } from '../stable-sort-domain';
|
||||
import { RuleOutput } from './base';
|
||||
import type { SingboxSourceFormat } from '../singbox';
|
||||
|
||||
@ -96,18 +95,18 @@ export class DomainsetOutput extends RuleOutput<Preprocessed> {
|
||||
|
||||
mitmSgmodule = undefined;
|
||||
|
||||
adguardhome(whitelist: Set<string | `.${string}`>): string[] {
|
||||
adguardhome(): string[] {
|
||||
const results: string[] = [];
|
||||
|
||||
const whitelistArray = sortDomains(Array.from(whitelist));
|
||||
for (let i = 0, len = whitelistArray.length; i < len; i++) {
|
||||
const domain = whitelistArray[i];
|
||||
if (domain[0] === '.') {
|
||||
results.push(`@@||${domain.slice(1)}^`);
|
||||
} else {
|
||||
results.push(`@@|${domain}^`);
|
||||
}
|
||||
}
|
||||
// const whitelistArray = sortDomains(Array.from(whitelist));
|
||||
// for (let i = 0, len = whitelistArray.length; i < len; i++) {
|
||||
// const domain = whitelistArray[i];
|
||||
// if (domain[0] === '.') {
|
||||
// results.push(`@@||${domain.slice(1)}^`);
|
||||
// } else {
|
||||
// results.push(`@@|${domain}^`);
|
||||
// }
|
||||
// }
|
||||
|
||||
for (let i = 0, len = this.$preprocessed.length; i < len; i++) {
|
||||
const domain = this.$preprocessed[i];
|
||||
|
||||
@ -958,7 +958,7 @@ stat.u.sb
|
||||
|
||||
.stats.mokeedev.com
|
||||
tongji.tom.com
|
||||
ads.tvb.com
|
||||
.ads.tvb.com
|
||||
ad.juksy.com
|
||||
tag.clearbitscripts.com
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user