Fine-grained "$third-party" filter

Various discussions related to Adblock Plus development

Fine-grained "$third-party" filter

Postby Gabrial1 » Fri Oct 18, 2019 8:20 pm

Hello everyone,,
Similar previous discussions about this: ... 00145.html

In 2008, adp introduced "$third-party" filter, so scripts from other domains may be blocked, and I believe this is very good start. In reality however, many sites put their own resources under subdomains with similar names, i.e. "" may include scripts from "". Treating the later domain as external may break things, and $third-party filter is inappropriate here.
mobdro lucky patcher kodi
Noscript has something called "base 2nd level domains". It is not perfect applicable as pointed out in the above link, but it certainly gives a nice direction.

I'm thinking about adding a numerical parameter, such as "$third-party=1", to get a fine-grained control of the level of "externality". For example, given a site "", applying
$third-party=0 allows "" (current behavior)
$third-party=1 allows *
$third-party=2 allows *
$third-party= -1 allows *.com
$third-party= -2 allows * (which is the behavior of "2nd level domain" in Noscript)

Is this option possible to be implemented? :D
Posts: 7
Joined: Fri Sep 27, 2019 1:36 pm

Re: Fine-grained "$third-party" filter

Postby greiner » Mon Oct 21, 2019 2:34 pm

Thanks for the suggestion!

Unfortunately, I cannot access the page you're linking to because the link is invalid. What I can already say is that we're reducing both domains we're comparing against each other to their base domain before we check whether they're equal (see code).

Therefore "" should not be considered third-party when compared to "" because both share the same base domain (i.e. "").

That being said, allowing filter authors to have more control over what should be considered third-party, could be useful. I don't know whether doing that on a domain level basis, as suggested, would be good enough for the use-case you mentioned because a site's CDN may not even be hosted under the same base domain as the actual website (e.g. "" instead of ""). Plus, some required resources may be hosted on a completely unrelated domain (e.g.
User avatar
ABP Developer
Posts: 689
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

Return to Adblock Plus development

Who is online

Users browsing this forum: No registered users and 1 guest