FiltersCompiler
FiltersCompiler copied to clipboard
Add "!#if dns" and "!#if !dns" for AdGuard DNS and AdGuard for Windows/Android's DNS filtering
I remember thinking about something like this a few times earlier this year, but kept forgetting it each time; until I was reminded about it again tonight on Slack.
Essentially, !#if dns would be:
True on: AdGuard Home, AdGuard for Windows/Mac/Android's DNS Filtering, AdGuard DNS
False on: AdGuard Browser Extension, AdGuard for Windows/Mac/Android's ordinary filtering, uBlock Origin, AdGuard for Safari (all versions), AdGuard Content Blocker
I've forgot which scenarios where I personally would've needed it, but it's perfectly probable for a site to need a domain block/allow in AdGuard Home, while the entry would've simultaneously been way too broad for all other mainstream adblockers.
If AdGuard adds this, @gorhill should too Where this could be helpful:
- Disabling unsupported filtering types (i.e. cosmetic filtering)
- Supplementing for unsupported filtering types
- Disabling entries designed only for specific scenarios (i.e. $popup, which has caused trouble) or which were designed just as a warning (i.e. $document for an potentially unwanted site)
In uBO, !#if dns would pretty much be equivalent to !#if false, which I do use to mark entries as being ABP-only.
Wish ABP supported !#if, but I guess it is just one more reason I can use in arguments to switch to uBlock Origin/AdGuard
Hmm, I am not sure about this. You see, AdGuard already has a clear distinction between "content blocking lists" and "DNS filtering blocklists". This feature would make perfect sense if we applied content blocking lists to DNS queries, but that's not the case.
Do you think we should extend pre-processor directives and hints to DNS blocklists? Currently, they support neither.
I do think those should be extended to DNS blocklists; as well as to custom blocklists in regular filtering modes.
Let's wait until the "HostlistsRegistry" repo is up, it makes sense to add this feature request there.