AdguardTeam / AdguardTeam/Scriptlets

Access to the compatibility table via the Scriptlet API

Open
#237 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
195
Forks
33
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.