Support for $third-party in blocklists

I’ve found a bit of complication:

Some adblock-flavored blocklists only register domains as third party (e.g. EasyList).
i.e. ||domain.com^$third-party.
It seems that Pi-Hole ignores these, to allow their access as first party.

An option to extend the blocking to these would be nice.
As it stands, users have to manually filter the $third-party tag.

That won't happen: A filtering DNS server only sees DNS requests, i.e. it cannot be aware of any contextual information nor any other resources, like a browser typically retreives from a webserver handling the domain.

The easy list you linked contains many such elements beyond the domain list, e.g.:

-ad-manager/$~stylesheet
-ad-sidebar.$image
-ad.jpg.pagespeed.$image
-ads-manager/$domain=~wordpress.org
-ads/assets/$script,domain=~web-ads.org
-assets/ads.$~script
-banner-ads-$~script
-contrib-ads.$~stylesheet
-sponsor-ad.$image
-web-advert-$image
.adriver.$~object,domain=~adriver.co
.ads.controller.js$script

In other words:
That list isn't intended to be used with a DNS filter, but with a browser extension:

The links listed below allow you to select filter lists for use in your browser provided that you are using a compatible ad blocker (…)

(quoted from https://easylist.to/index.html, emphasis mine)

Yes, I was not aiming at all the path parts.

But anyway, I see that some blocklist do apply first-party filtering to these ad domains (e.g. HaGeZi‘s DNS blocklist).

So, once again, it turned out that the most sensible solution already exists in some form.

There should be some FAQ post about this whole journey.
But the FAQ category seem to be a bit clutered now.

A list containing "filters" or "options" ($ character followed by some rule) is not supported because Pi-hole can't do anything with this rules.

These filters/options target paths or elements inside the content, but Pi-hole only sees domains.

Since Pi-hole can't see the content, rules including a filter that depends on the content must be ignored.

These lists are intended to work with browser extensions that are able to see the whole page/content and remove or hide some elements.


Please note that you are requesting to automatically change entries containing $xxxxx into something else and use it anyway.

You are asking for Pi-hole to simply remove the filter part of an entry and use it, but removing that part will effectively change the rule into something completely different.

Example:
The rule ||domain.com^$third-party is asking to block the domain only if it is a "third-party" domain.
If Pi-hole removes the invalid part as you are asking, the rule would become ||domain.com^, which should block the domain unconditionally.

The 2 important points:

  1. Pi-hole has no idea what a "first-party" or "third-party" domain is.
    Pi-hole only sees one domain per request.
    There is no page, no content and no context to verify whether a domain is a "third-party" or not.
    That's why the whole line is considered invalid and ignored.

  2. Even if Pi-hole were modified to accept this type of entry and alter them, these lists would function differently than they would if used in a browser extension.
    They would over-block, causing issues for many users.

The list linked on your first post was created for browser extensions only.
Do not try to use it with Pi-hole.

Lists containing rules using the ||domain.com^ format (to remove the domains) are accept since March 2023.