AdguardTeam / AdguardTeam/Scriptlets

Access to the compatibility table via the Scriptlet API

Abierto
#237 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
195
Forks
33
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.