Skip to content

Describe changes to element hiding rules in CoreLibs 1.18 #692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
a `remove: true` declaration:

```adblock
example.org##body { remove: true; }
```

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 (`#@#`) are matched by the selector part only, ignoring the declarations block part.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Element hiding exceptions (`#@#`) are matched by the selector part only, ignoring the declarations block part.
Element hiding exceptions (`#@#`) are matched by the selector part only, ignoring the declaration part.

Copy link
Member Author

Choose a reason for hiding this comment

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

{ remove: true; } is the declarations block, I'm refering to the part of the rule that is the declarations block :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I see
ignore my suggestion then :)

For example, the above rule can be disabled by any of the following exception rules:

```adblock
example.org#@#body
example.org#@#body { remove: true; }
example.org#@#body{remove:true;}
```

:::

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

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