mirror of
https://github.com/AdguardTeam/AdguardKnowledgeBase.git
synced 2025-02-20 11:13:10 +08:00
update path modifier description for non-basic rules
This commit is contained in:
commit
3d0ccab2de
@ -2315,24 +2315,26 @@ But rules with mixed style domains restriction are considered invalid. So, for e
|
||||
|
||||
#### Syntax
|
||||
```
|
||||
path=pattern
|
||||
$path ["=" pattern]
|
||||
```
|
||||
|
||||
`pattern` is a path mask to which the rule is restricted. Its syntax and behavior are pretty much the same as with the [pattern for basic rules](#basic-rules-syntax). You can also use [special characters](#basic-rules-special-characters), except for `||`, which does not make any sense in this case (see examples below).
|
||||
`pattern` — optional, a path mask to which the rule is restricted. Its syntax and behavior are pretty much the same as with the [pattern for basic rules](#basic-rules-syntax). You can also use [special characters](#basic-rules-special-characters), except for `||`, which does not make any sense in this case (see examples below). If not set, rule will apply only on the main page of website.
|
||||
|
||||
> If `pattern` is not set for `$path`, rule will apply only on the main page of website.
|
||||
|
||||
> Please note that `path` modifier matches the query string as well.
|
||||
> Please note that `$path` modifier matches the query string as well.
|
||||
|
||||
> `$path` modifier supports regular expressions in [the same way](#regexp-support) basic rules do.
|
||||
|
||||
#### `path` examples:
|
||||
* `[$path=page.html]##.textad` — hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` or `/sub/page.html` or `/another_page.html`
|
||||
* `[$path=/page.html]##.textad` — hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` or `/sub/page.html` of any domain but not at `/another_page.html`
|
||||
* `[$path=|/page.html]##.textad` — hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` of any domain but not at `/sub/page.html`
|
||||
* `[$path=/page.html|]##.textad` — hides a `div` with a class `textad` at `/page.html` or `/sub/page.html` of any domain but not at `/page.html?<query>`
|
||||
* `[$path=/page*.html]example.com##.textad` — hides a `div` with a class `textad` at `/page1.html` or `/page2.html` or any other path matching `/page<...>.html` of `example.com`
|
||||
* `[$domain=example.com,path=/page.html]##.textad` — hides a `div` with a class `textad` at `page.html` of `example.com` and all subdomains but not at `another_page.html`
|
||||
* `[$path=/\\/(sub1|sub2)\\/page\\.html/]##.textad` — hides a `div` with a class `textad` at both `/sub1/page.html` and `/sub2/page.html` of any domain (please, note the [escaped special characters](#non-basic-rules-modifiers-syntax))
|
||||
* `[$path=page.html]##.textad` hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` or `/sub/page.html` or `/another_page.html`
|
||||
* `[$path=/page.html]##.textad` hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` or `/sub/page.html` of any domain but not at `/another_page.html`
|
||||
* `[$path=|/page.html]##.textad` hides a `div` with a class `textad` at `/page.html` or `/page.html?<query>` of any domain but not at `/sub/page.html`
|
||||
* `[$path=/page.html|]##.textad` hides a `div` with a class `textad` at `/page.html` or `/sub/page.html` of any domain but not at `/page.html?<query>`
|
||||
* `[$path=/page*.html]example.com##.textad` hides a `div` with a class `textad` at `/page1.html` or `/page2.html` or any other path matching `/page<...>.html` of `example.com`
|
||||
* `[$path]example.com##.textad` hides a `div` with a class `textad` at the main page of `example.com`
|
||||
* `[$domain=example.com,path=/page.html]##.textad` hides a `div` with a class `textad` at `page.html` of `example.com` and all subdomains but not at `another_page.html`
|
||||
* `[$path=/\\/(sub1|sub2)\\/page\\.html/]##.textad` hides a `div` with a class `textad` at both `/sub1/page.html` and `/sub2/page.html` of any domain (please, note the [escaped special characters](#non-basic-rules-modifiers-syntax))
|
||||
|
||||
> **Compatibility with different versions of AdGuard.** Rules with `$path` modifier are supported by AdGuard for Windows, Mac, Android, and AdGuard Browser extension for Chrome, Firefox, Edge.
|
||||
|
||||
|
@ -2296,23 +2296,26 @@ modifiers = modifier0[, modifier1[, ...[, modifierN]]]
|
||||
|
||||
#### Синтаксис
|
||||
```
|
||||
path=pattern
|
||||
$path ["=" pattern]
|
||||
```
|
||||
|
||||
`pattern` — это маска пути, которой ограничено правило. Его синтаксис и поведение почти такие же, как в [шаблоне базовых правил](#basic-rules-syntax). Вы также можете использовать [специальные символы](#basic-rules-special-characters), за исключением `||`, поскольку в этом случае это не имеет никакого смысла (см. примеры ниже).
|
||||
`pattern` — необязательный, это маска пути, которой ограничено правило. Его синтаксис и поведение почти такие же, как в [шаблоне базовых правил](#basic-rules-syntax). Вы также можете использовать [специальные символы](#basic-rules-special-characters), за исключением `||`, поскольку в этом случае это не имеет никакого смысла (см. примеры ниже).
|
||||
|
||||
> Обратите внимание, что модификатор пути также соответствует параметрам запроса.
|
||||
> Если `pattern` не указан для модификатора `$path`, правило применится только на главной странице сайта.
|
||||
|
||||
> Модификатор `path` поддерживает регулярные выражения [таким же образом](#regexp-support), что и базовые правила.
|
||||
> Обратите внимание, что модификатор `$path` также соответствует параметрам запроса.
|
||||
|
||||
#### Примеры `path`:
|
||||
* `[$path=page.html]##.textad` — скрывает `div` с классом `textad` на `/page.html`, `/page.html?<query>`, `/sub/page.html` или `/another_page.html`
|
||||
* `[$path=/page.html]##.textad` — скрывает `div` с классом `textad` на `/page.html`, `/page.html?<query>`, `/sub/page.html` любого домена, но не на `/another_page.html`
|
||||
* `[$path=|/page.html]##.textad` — скрывает `div` с классом `textad` на `/page.html` или `/page.html?<query>` любого домена, но не на `/sub/page.html`
|
||||
* `[$path=/page.html|]##.textad` — скрывает `div` с классом `textad` на `/page.html` или `/sub/page.html` любого домена, но не на `/page.html?<query>`
|
||||
* `[$path=/page*.html]example.com##.textad` — скрывает `div` с классом `textad` на `/page1.html`, `/page2.html` или любом другом пути, соответствующим `/page<...>.html`, на домене `example.com`
|
||||
* `[$domain=example.com,path=/page.html]##.textad` — скрывает `div` с классом `textad` на `page.html` домена `example.com` и всех его поддоменах, но не на `another_page.html`
|
||||
* `[$path=/\\/(sub1|sub2)\\/page\\.html/]##.textad` — скрывает `div` с классом `textad` как на `/sub1/page.html`, так и `/sub2/page.html` любого домена (обратите внимание на [экранированные символы](#non-basic-rules-modifiers-syntax))
|
||||
> Модификатор `$path` поддерживает регулярные выражения [таким же образом](#regexp-support), что и базовые правила.
|
||||
|
||||
#### Примеры `$path`:
|
||||
* `[$path=page.html]##.textad` скрывает `div` с классом `textad` на `/page.html`, `/page.html?<query>`, `/sub/page.html` или `/another_page.html`
|
||||
* `[$path=/page.html]##.textad` скрывает `div` с классом `textad` на `/page.html`, `/page.html?<query>`, `/sub/page.html` любого домена, но не на `/another_page.html`
|
||||
* `[$path=|/page.html]##.textad` скрывает `div` с классом `textad` на `/page.html` или `/page.html?<query>` любого домена, но не на `/sub/page.html`
|
||||
* `[$path=/page.html|]##.textad` скрывает `div` с классом `textad` на `/page.html` или `/sub/page.html` любого домена, но не на `/page.html?<query>`
|
||||
* `[$path=/page*.html]example.com##.textad` скрывает `div` с классом `textad` на `/page1.html`, `/page2.html` или любом другом пути, соответствующим `/page<...>.html`, на домене `example.com`
|
||||
* `[$path]example.com##.textad` скрывает `div` с классом `textad` на главной странице сайта `example.com`
|
||||
* `[$domain=example.com,path=/page.html]##.textad` скрывает `div` с классом `textad` на `page.html` домена `example.com` и всех его поддоменах, но не на `another_page.html`
|
||||
* `[$path=/\\/(sub1|sub2)\\/page\\.html/]##.textad` скрывает `div` с классом `textad` как на `/sub1/page.html`, так и `/sub2/page.html` любого домена (обратите внимание на [экранированные символы](#non-basic-rules-modifiers-syntax))
|
||||
|
||||
> **Совместимость с разными версиями AdGuard.** Правила с модификатором `$path` поддерживаются в AdGuard для Windows, Mac, Android и Браузерном расширении AdGuard для Chrome, Firefox, Edge.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user