brave / brave/adblock-rust

Generic cosmetics exceptions are being ignored.

Open
#230 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.8k
Forks
250
Avg merge
1d 16h
Merged PRs (30d)
6

Description

I have seen this issue in Brave for years with the generic cosmetics exceptions are being totally ignored by Brave's adblocker. Don't know the cause though, if it is just not supported or it is bugged, but it should be fixed or supported because I see now the negative effects this is causing in many websites.

Many anti-adblockers are using the: If element = `display: none`, then = Adblocker.

[uBlock Filters has many generic cosmetics exceptions to deal with this](https://github.com/uBlockOrigin/uAssets/blob/4e1ba2a99039088cb4a70101f6f25c19ed7544f4/filters/filters-2021.txt#L6931) and lines like [this ](https://github.com/uBlockOrigin/uAssets/blob/4e1ba2a99039088cb4a70101f6f25c19ed7544f4/filters/filters-2021.txt#L6829)

- **Where to see this issue? The easiest way I found to test this:**
Go to [tvnet.lv](https://www.tvnet.lv/) and you should see adblocker being detected, that's because Easylist is blocking the element and uBlock is trying to whitelist it and Brave is just not working with the generic exception uBlock list has.

**If you add:**
tvnet.lv#@#.adBanner
to the custom filters, it should work just fine, because the exceptions are working if you add the domain, but not as generic like uBlock list has it and works properly with it.

These is another example to show this problem:

[https://links.medipost.org/6qTD](https://links.medipost.org/6qTD)

```
medipost.org#@#.ad-banner
medipost.org#@##ad-banner
```

So basically the issue is how Brave can use generic cosmetics but not generic cosmetic exceptions, some pages sometimes need $ghide because their implementations detects more blocked DOM elements than just those two, and sometimes they are random, which is more problematic. But that's why in uBlock those websites work fine without being detected and not in Brave

Thank you.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the behavior on tvnet.lv and the medipost.org examples, comparing generic cosmetic exceptions from the linked uBlock Filters with the domain-specific custom filters that work. Trace how the adblock engine handles generic cosmetics and exceptions; done means those generic exceptions prevent the demonstrated anti-adblock detection without requiring domain-specific rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.