Fine-grained "$third-party" filter

Various discussions related to Adblock Plus development
Post Reply
Gabrial1
Posts: 6
Joined: Fri Sep 27, 2019 1:36 pm

Fine-grained "$third-party" filter

Post by Gabrial1 »

Hello everyone,,
Similar previous discussions about this:
http://www.mozdev.org/pipermail/adblock ... 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. "www.a.bbc.example.com" may include scripts from "b.bbc.example.com". 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 "www.a.bbc.example.com", applying
$third-party=0 allows "www.a.bbc.example.com" (current behavior)
$third-party=1 allows *.a.bbc.example.com
$third-party=2 allows *.bbc.example.com
$third-party= -1 allows *.com
$third-party= -2 allows *.example.com (which is the behavior of "2nd level domain" in Noscript)

Is this option possible to be implemented? :D
User avatar
greiner
ABP Developer
Posts: 899
Joined: Mon Sep 03, 2012 5:29 pm
Location: Cologne, Germany

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

Post by greiner »

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 "www.a.bbc.example.com" should not be considered third-party when compared to "b.bbc.example.com" because both share the same base domain (i.e. "example.com").

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. "cdnexample.com" instead of "cdn.example.com"). Plus, some required resources may be hosted on a completely unrelated domain (e.g. code.jquery.com).
justin619
Posts: 1
Joined: Thu Mar 26, 2020 10:28 am

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

Post by justin619 »

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 (showbox.click)
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.
Cheers
Justin
Post Reply