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.

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: 6
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: 803
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

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

Postby justin619 » Thu Mar 26, 2020 11:33 am

I am working for a start up and they have given me a task to develop a add blocker and also only display there ads, blocking rest of the adds, is that even possible ?
I am not sure if that is possible.

They are a bunch of crazy geeks and expect me deliver the product within a month.

I am not sure even is that is possible.

The relation is with Showbox (
I am not sure how to go about this one.
Do let me know, if any one could help.

Or at least point me in a right direction.
Posts: 1
Joined: Thu Mar 26, 2020 11:28 am

Return to Adblock Plus development

Who is online

Users browsing this forum: No registered users and 4 guests