FiltersCompiler icon indicating copy to clipboard operation
FiltersCompiler copied to clipboard

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

Open DandelionSprout opened this issue 3 years ago • 6 comments

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.

DandelionSprout avatar Nov 23 '21 23:11 DandelionSprout

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)

iam-py-test avatar Nov 23 '21 23:11 iam-py-test

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

DandelionSprout avatar Nov 24 '21 00:11 DandelionSprout

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

iam-py-test avatar Nov 24 '21 00:11 iam-py-test

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.

ameshkov avatar Nov 24 '21 07:11 ameshkov

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

DandelionSprout avatar Nov 24 '21 15:11 DandelionSprout

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

ameshkov avatar Nov 25 '21 09:11 ameshkov