tsurlfilter
tsurlfilter copied to clipboard
The `$app` modifier is ignored by the DnsEngine
$app=com.miui.systemAdSolution matches all hostnames.
const dnsResult = dnsEngine.match(hostname);
if (dnsResult.basicRule && !dnsResult.basicRule.isAllowlist()) {
// blocking rule found
..
}
if (dnsResult.hostRules.length > 0) {
// hosts rules found
..
}
'$app=com.fiberhome.wifiserver'
'$app=com.miui.analytics'
These rules always match as a basic rule. It is a bug, isn't it?
@demian-parkhomenko generally, tsurlfilter
just ignores the $app
modifier in the current version. It was added to tsurlfilter
just for the sake of compatibility with CoreLibs/DnsLibs (the other engines that we use in AdGuard apps).
@maximtop I think we have two options here:
- Make the
$app
modifier work. - Introduce a "compatibility level" concept to
tsurlfilter
with the following options:Extension
,DNS
,CoreLibs
. The supported modifiers should depend on the compatibility level.