Skip to content

Commit

Permalink
Merge pull request #280 from AdguardTeam/gh-1013-replace-modifier-des…
Browse files Browse the repository at this point in the history
…cription

[GH-1013] Ignoring rules
  • Loading branch information
vbagirov authored Sep 12, 2023
2 parents 1692ed1 + 8712129 commit a93dd31
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion docs/general/ad-filtering/create-own-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Filtering rules support numerous modifiers that allow you to fine-tune the rule

**This rule blocks:**

- `http://example.org/script.js` if this script is loaded from `example.org`.
- `http://example.org/script.js` if this script is loaded from `example.com`.

**This rule does not block:**

Expand Down Expand Up @@ -204,6 +204,68 @@ AdGuard Safari and AdGuard for iOS do not fully support regular expressions beca

:::

### Restrictions on rules application {#rules-restrictions}

Rules that match an arbitrarily large number of URLs are considered incorrect and will be ignored. This can happen if the rule doesn't contain a mask, or if the mask matches any URL with a certain protocol.

This rule will be ignored:

```text
|http://$replace=/a/b/
```

This limitation can be circumvented by using a `/.*/` regular expression inside the mask.

This rule will not be ignored:

```text
/.*/$replace=/a/b/
```

**Exceptions**

This rule validation is not applied in the following cases:

1. The rule contains [`$domain`](#domain-modifier) modifier that points to a specific domain list.

These rules will not be ignored:

```text
$domain=example.com,script
$domain=example.*,script
```
This rule will be ignored because of domain negation, which causes too wide of a rule application scope:
```text
$domain=~example.com,script
```
1. The rule contains [`$app`](#app-modifier) modifier that points to a specific app list.
This rule will not be ignored:
```text
$app=curl,document
```
This rule will be ignored because of app negation, which causes too wide of a rule application scope:
```text
$app=~curl,document
```
1. The rule contains one or more modifiers from among [`$cookie`](#cookie-modifier), [`$removeparam`](#removeparam-modifier), [`$removeheader`](#removeheader-modifier), [`$stealth`](#stealth-modifier).
These rules will not be ignored:
```text
$removeparam=cx_recsWidget
$cookie=ibbid
$removeheader=location
$stealth
```
### Wildcard support for TLD (top-level domains) {#wildcard-for-tld}
Wildcard characters are supported for TLDs of the domains in patterns of [cosmetic](#cosmetic-rules), [HTML filtering](#html-filtering-rules) and [JavaScript](#javascript-rules) rules.
Expand Down

0 comments on commit a93dd31

Please sign in to comment.