AdguardTeam / FiltersCompiler

A tool that compiles & validates filters
GNU Lesser General Public License v3.0
52 stars 12 forks source link

Add "!#if dns" and "!#if !dns" for AdGuard DNS and AdGuard for Windows/Android's DNS filtering #128

Open DandelionSprout opened 2 years ago

DandelionSprout commented 2 years ago

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.

iam-py-test commented 2 years ago

If AdGuard adds this, @gorhill should too Where this could be helpful:

DandelionSprout commented 2 years ago

In uBO, !#if dns would pretty much be equivalent to !#if false, which I do use to mark entries as being ABP-only.

iam-py-test commented 2 years ago

Wish ABP supported !#if, but I guess it is just one more reason I can use in arguments to switch to uBlock Origin/AdGuard

ameshkov commented 2 years ago

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.

DandelionSprout commented 2 years ago

I do think those should be extended to DNS blocklists; as well as to custom blocklists in regular filtering modes.

ameshkov commented 2 years ago

Let's wait until the "HostlistsRegistry" repo is up, it makes sense to add this feature request there.