brave / adblock-rust

Brave's Rust-based adblock engine
Mozilla Public License 2.0
1.44k stars 124 forks source link

Application of cosmetic filters by TLD #150

Closed antonok-edm closed 3 years ago

antonok-edm commented 3 years ago

From https://adblockplus.org/filter-cheatsheet

Example rules Domain selection
example.com##selector Active on, for example:
  • http://example.com/
  • ftp://subdomain.example.com/
Not active on:
  • All other domains, including
  • http://example.edu/
  • ftp://example.net/

An issue occurred where toolforge.org##+js(abort-on-property-read, noAdBlockers) wasn't being applied on https://pageviews.toolforge.org/?project=en.wikipedia.org&platform=all-access&agent=user&redirects=0&range=latest-20&pages=RStudio.

As it turns out, toolforge.org is actually a private TLD, and the rule should probably be made more specific. However, this is currently a difference from uBlock Origin, which would still apply the rule.

adblock-rust should be updated to match these cosmetic rules by arbitrary hostname segments, rather than being aware of the domain/TLD hierarchy.

antonok-edm commented 3 years ago

Fixed by 8952994b01fadb493e272f570a7fb4e72c3faf1e