AdguardTeam / AdguardTeam/Scriptlets

Access to the compatibility table via the Scriptlet API

Aperta
#237 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
195
Fork
33
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

TSUrlFilter issue reference: https://github.com/AdguardTeam/tsurlfilter/issues/60

Compatibility table contains **ALL** ABP/uBO scriptlets, _even if AdGuard doesn't yet support one of them_. However, the API currently only allows to determine whether a scriptlet is supported by Adguard or not. This function is called `isValidScriptletRule`. This function is also [used by](https://github.com/AdguardTeam/tsurlfilter/blob/d5d820d315e362e44d74890ecc3203d87baf6ba6/packages/tsurlfilter/src/rules/rule-converter.ts#L190) the TSUrlFilter converter.

Take the example below:
```ts
RuleConverter.convertRule('ebay.com#$#hide-if-contains-visible-text /Sponsored/ div[aria-label] div[class]');
```
This will produce the following array (i.e. the rule remains unchanged, since `hide-if-contains-visible-text` isn't supported by ADG):
```ts
['ebay.com#$#hide-if-contains-visible-text /Sponsored/ div[aria-label] div[class]']
```
If we pass this rule to `RuleFactory.createRule`, it will detect it as a bad CSS injection rule. After all, the unsupported rule is not created, only an incorrect error message is displayed.

**I think it would be a good idea to somehow make the compatibility table available through the API.** This would increase compatibility and make the above case also solvable, since it could be checked if a script exists (the compatibility table contains ALL scriptlets) but not supported by ADG. For example, `hide-if-contains-visible-text` is a valid ABP scriptlet, only ADG does not support it yet.

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.