brave / brave/adblock-rust

Support for `$specifichide`

Open
#327 0 comments 2 reactions 0 assignees View on GitHub
uBO-parity
Dominant language
Rust
Stars
2.8k
Forks
250
Avg merge
1d 16h
Merged PRs (30d)
6

Description

Brave Adblocker already supports [$generichide](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#generichide), it would be good if Brave supported [$specifichide](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#specifichide) as well, and this way have full support for [$elemhide](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#elemhide) as well.

generichide = doesn't apply generic cosmetics to a specified website.

specifichide = doesn't apply the specific cosmetics to the specified website.

elemhide = the combinations of both generichide and specifichide.

Brave is sometimes difficult to troubleshoot when it comes to Default lists because list can't be easily turned off individually to see 'which one breaks a website', although I have a workaround myself on Windows, it can't be applied to Android unless the phone was rooted and all that.
Regional lists have the problem if having a different logic than Default lists when it comes to Aggressive vs Standard, where you can easily set the adblocker to standard and have all the cosmetics turned off, and make sure if it is a scriptlet injection or cosmetic or network request the one breaking a website.

`$specifichide`, would just make it faster to know if a specific cosmetic is breaking the website, or a generic rule or it is something else,, then that way go further and filter it until finding the problematic rule.
Having to hunt many individual cosmetic rules to create an exception is not hard to do, but it is something 'normal users' won't do as a troubleshoot mechanism, if you tell the non adblocker people _Can you try by adding `@@||example.com^$shide` _ instead of 20 rules with just the `#@#`, would make things easier.

Also one issue is how Brave doesn't have a logger for anything but network request rules, so it is hard to know which cosmetics are being applied to a website. Unless you check the lists.
Sometimes it can be just the typical generic cosmetic exception Brave doesn't support or some redirect rule, it is all random and hard to know without a better logger.
But at least specific would be good for regional lists, unless there was a way to make custom lists and custom rules to do the 1p and 3p in standard or aggressive mode and only use the logic for the regional lists.... Not my preferred methods because you are not applying some 1p network request rules, but just anything to quickly know if it is a cosmetic or not would be good, and that's only achieve with `$shide`.

Thank you.

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace the existing `$generichide` handling in the Rust adblock engine and compare it with the linked uBlock `$specifichide` syntax. Define how specific cosmetic rules are suppressed, add coverage for its interaction with `$elemhide`, and verify the behavior with representative filters.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.