AdguardTeam / AdguardTeam/AdguardBrowserExtension

Add support for `:remove-attr()` and `:remove-class()` from uBlock Origin

Aperta
#3,538 3 commenti 0 reazioni 1 assegnatario Assegnata a @maximtop Vedi su GitHub
Feature Request Priority: P4 Version: AdGuard v5.6
Lingua principale
TypeScript
Stelle
4.4k
Fork
449
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Issue Details

I would like to see support for the [`:remove-attr()` and `:remove-class()` operators](https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#subjectremove-attrarg-subjectremove-classarg) used in uBlock Origin.

AdGuard's documentation for [`remove-attr`](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#remove-attr) and [`remove-class`](https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-scriptlets.md#-%EF%B8%8F-remove-class) link to a uBO JS scriptlet of the same name. However, those uBO scriptlets were deprecated in favor of the previously mentioned remove operators. As a result, removing an attribute requires two different filters to ensure compatibility with both AdGuard and uBlock Origin.

```
! AdGuard compatible
example.com#%#//scriptlet('remove-attr', 'href', 'a')
! uBlock Origin compatible
example.com##a:remove-attr(href)
```

### Proposed solution

Implement uBlock Origin's `:remove-attr()` and `:remove-class()` operators in a way that filters can be compatible with both. (It can silently convert them to the scriptlet methods)

### Alternative solution

_No response_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.