Skip to content

Commit 29b22b0

Browse files
authored
[AG-49140] Updated HTML filtering syntax for AdGuard Browser Extension (#808)
1 parent 703fc22 commit 29b22b0

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/general/ad-filtering/create-own-filters.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4261,6 +4261,8 @@ The syntax with an optional `value` in the attributes is supported by AdGuard fo
42614261
42624262
### Syntax
42634263
4264+
Syntax supported by AdGuard for Windows, AdGuard for Mac, AdGuard for Android, AdGuard for Linux with CoreLibs, and AdGuard Browser Extension prior to v5.2:
4265+
42644266
```text
42654267
selector = [tagName] [attributes] [pseudoClasses]
42664268
combinator = ">"
@@ -4278,6 +4280,24 @@ pseudoClasses = pseudoClass *pseudoClass
42784280
- **`pseudoArgs`** — the arguments of a function-style pseudo-class.
42794281
- **`combinator`** — an operator that works similarly to the [CSS child combinator](https://developer.mozilla.org/en-US/docs/Web/CSS/Child_combinator): that is, the `selector` on the right of the `combinator` will only match an element whose direct parent matches the `selector` on the left of the `combinator`.
42804282
4283+
Syntax supported by AdGuard Browser Extension v5.3 or later:
4284+
4285+
```text
4286+
rule = [domains] "$$" selector
4287+
domains = [domain0, domain1[, ...[, domainN]]]
4288+
```
4289+
4290+
- **`selector`** — [CSS selector](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors), defines the element(s) to be removed from the HTML code before the page is loaded.
4291+
- **`domains`** — domain restriction for the rule. Same principles as in [element hiding rule syntax](#cosmetic-elemhide-rules).
4292+
4293+
:::caution Limitations
4294+
4295+
The following limitations apply to AdGuard Browser Extension v5.3 and later:
4296+
4297+
- Pseudo-elements (e.g., `::before`, `::after`) are not supported, as they are not applicable in the context of HTML filtering.
4298+
4299+
:::
4300+
42814301
### Examples
42824302
42834303
**HTML code:**
@@ -4343,6 +4363,8 @@ $$script[tag-content="banner"]
43434363
43444364
The `tag-content` special attribute must not appear in a selector to the left of a `>` combinator.
43454365
4366+
This limitation does not apply to AdGuard Browser Extension v5.3 or later.
4367+
43464368
:::
43474369
43484370
#### `wildcard`
@@ -4367,6 +4389,8 @@ It checks if the element code contains the two consecutive substrings `banner` a
43674389
43684390
The `wildcard` special attribute must not appear in a selector to the left of a `>` combinator.
43694391
4392+
This limitation does not apply to AdGuard Browser Extension v5.3 or later.
4393+
43704394
:::
43714395
43724396
#### `max-length`
@@ -4395,6 +4419,8 @@ This rule will remove all the `div` elements, whose code contains the substring
43954419
43964420
The `max-length` special attribute must not appear in a selector to the left of a `>` combinator.
43974421
4422+
This limitation does not apply to AdGuard Browser Extension v5.3 or later.
4423+
43984424
:::
43994425
44004426
#### `min-length`
@@ -4419,6 +4445,8 @@ This rule will remove all the `div` elements, whose code contains the substring
44194445
44204446
The `min-length` special attribute must not appear in a selector to the left of a `>` combinator.
44214447
4448+
This limitation does not apply to AdGuard Browser Extension v5.3 or later.
4449+
44224450
:::
44234451
44244452
### Pseudo-classes {#html-filtering-rules--pseudo-classes}
@@ -4445,7 +4473,7 @@ or
44454473
44464474
:::info Compatibility
44474475
4448-
The `:contains()` pseudo-class is supported by AdGuard for Windows, AdGuard for Mac, AdGuard for Android, and AdGuard for Linux with [CoreLibs] v1.13 or later.
4476+
The `:contains()` pseudo-class is supported by AdGuard for Windows, AdGuard for Mac, AdGuard for Android, AdGuard for Linux with [CoreLibs] v1.13 or later, and AdGuard Browser Extension v5.3 or later.
44494477
44504478
:::
44514479
@@ -4455,6 +4483,8 @@ Requires that the inner HTML of the element contains the specified text or match
44554483
44564484
A `:contains()` pseudo-class must not appear in a selector to the left of a `>` combinator.
44574485
4486+
This limitation does not apply to AdGuard Browser Extension v5.3 or later.
4487+
44584488
:::
44594489
44604490
### Exceptions

0 commit comments

Comments
 (0)