brave / brave/adblock-rust

Adblocker seems to ignore attribute filters

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

Description

I have these rules for [Yandex Market](https://market.yandex.ru):

```adblock
market.yandex.ru##div["data-apiary-widget-name"*="@monetize/"]
market.yandex.ru##div["data-apiary-widget-name"="@marketfront/MadvHeaderPromo"]
```

These are straight from [Adblock Plus syntax](https://help.adblockplus.org/hc/en-us/articles/360062733293-How-to-write-filters#elemhide_attributes) which adblocker claims to support.

Still, this div is not blocked/hidden:

![Image](https://github.com/user-attachments/assets/64b98af3-c2ff-4c64-a3d7-c4f00a9a83d6)

I tried using `:matches-attr()` from [uBlock's Wiki](https://github.com/gorhill/ublock/wiki/Procedural-cosmetic-filters#subjectmatches-attrarg):

```adblock
market.yandex.ru##div:matches-attr("data-apiary-widget-name"="/@monetize\/[^\s]+/")
market.yandex.ru##div:matches-attr("data-apiary-widget-name"="@marketfront/MadvHeaderPromo")
```

These still don't hide anything.

While with uBlock Origin and even Adblock Plus it works like a charm.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported filters on market.yandex.ru and compare the attribute-filter and :matches-attr() cases described in the issue. Trace the adblock-rust filter matching entry point to determine why these selectors do not hide the reported div; done means the supplied rules block it without breaking existing filter behavior.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.