AdguardTeam / AdguardTeam/Scriptlets

Access to the compatibility table via the Scriptlet API

オープン
#237 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
195
フォーク
33
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。