Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/general/ad-filtering/create-own-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -3435,6 +3435,28 @@ CSS rules may operate differently [depending on the platform](#cosmetic-rules-pr

:::

:::info Adblock Plus compatibility

In AdGuard products that use **CoreLibs version 1.18 or later**, you can also use element hiding rules to inject CSS.
For example:

```adblock
example.org##body { background-color: green; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest mentioning remove rules here, such as example.com##h1 { remove: true; }.
Another important point is that in the free version, only remove rules work — as far as I understand, other types of CSS injections (like coloring) are part of the premium ABP subscription.
ABP refers to these rules collectively as “Inline CSS” rules btw.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, if that's the case, can we limit the support to remove: true and just not support their premium functionality? It makes little sense since the rules for that are a part of their premium bundle and it cannot be shared&used in other ad blockers.

abptestpages.org##.testcase-inline-css-ehe {background-color: #c70d2c;}
```

This usage is discouraged in favor of using [CSS rules](#cosmetic-css-rules) and is only supported for compatibility with filter lists written for Adblock Plus.

Element hiding exceptions (`#@#`) can match such a rule both by its selector part and by the full rule text.
For example, the rule `example.org##body { background-color: green; }` can be disabled by any of the following exception rules:

```adblock
example.org#@#body
example.org#@#body { background-color: green; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, both options work in ABP, but what’s important is that ABP only checks the selector during allowlisting, while ADG checks the entire rule. We’ll probably need to resolve this inconsistency at some point.
cc @ameshkov

```

:::

### Extended CSS selectors {#extended-css-selectors}

- [Limitations](#extended-css-limitations)
Expand Down