dhowe / AdNauseam

AdNauseam: Fight back against advertising surveillance
GNU General Public License v3.0
4.51k stars 189 forks source link

Review and Document Filter Precedence #2119

Open mneunomne opened 2 years ago

mneunomne commented 2 years ago

How does Adnauseam precedence of filters work, and how should it work?

Discussion started in https://github.com/dhowe/AdNauseam/issues/2110

mneunomne commented 2 years ago

from https://github.com/dhowe/AdNauseam/issues/2110#issuecomment-1158886224

Precedence:

adnauseam.txt should override any other filter list (potentially by auto-adding $important) any user-added rule should override any other rule

mneunomne commented 2 years ago

from https://github.com/dhowe/AdNauseam/issues/2110#issuecomment-1158720546

How uBlock works:

How AdNauseam is currently working:

Given the URL:

https://a.nytimes.com/svc/nyt/data-layer?assetUrl=https%3A%2F%2Fwww.nytimes.com%2F&caller_id=nyt-vi&jkcb=1655455947978&referrer=&sourceApp=nyt-vi
Allow-Block-List (e.g. Adnauseam Filters) Adn-Allow-Lists (e.g. EasyList) Result
A \|\|nytimes.comˆ block
B \|\|nytimes.comˆ adn-allow
C \|\|nytimes.comˆ$important adn-allow
D \|\|nytimes.comˆ \|\|nytimes.comˆ block
F \|\|nytimes.comˆ \|\|nytimes.comˆ$important adn-allow
E \|\|nytimes.com/svc/nyt/data-layer$script \|\|nytimes.comˆ adn-allow
G \|\|nytimes.comˆ$important \|\|nytimes.com/svc/nyt/data-layer$script block

Comments

dhowe commented 2 years ago

Seems there are more cases to consider...

for uBlock:

plus, for AdNauseam: