brave / brave/adblock-rust

Element hiding rules (cosmetic filters) do not work with regex

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

Description

For example (tested using latest Brave 1.66.113 on macOS and iPadOS):
`/example\.com/` - blocks the website
`example.com##.adClass` - hides the appropriate element
however,
`/example.com/##.adClass` - does not work (does nothing). It does work in uBlock Origin

The behaviour was consistent across multiple websites. My apologies if this is expected behaviour but I couldn't find any mention of this in the issues open or closed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported difference between `/example\.com/##.adClass` and the working blocking and plain cosmetic-filter examples in the Rust adblock engine. Trace how regex host patterns are parsed and applied to cosmetic filters, then add coverage showing the regex-host cosmetic rule hides the matching element without regressing the existing cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.