Skip to content

Commit 137d503

Browse files
committed
[AG-31991] Remove complicated heuristics for $domain modifier
Now that we have the `$to` modifier, `$domain` will no longer match the target domain by default - only when the `$csp` or `$cookie` modifiers are specified. See-also: AG-31991 Signed-off-by: Alexey Zhavoronkov <[email protected]>
1 parent 602e49d commit 137d503

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

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

+4-17
Original file line numberDiff line numberDiff line change
@@ -537,34 +537,21 @@ If you want the rule not to be applied to certain domains, start a domain name w
537537

538538
**`$domain` modifier matching target domain:**
539539

540-
In some cases the `$domain` modifier can match not only the referrer domain, but also the target domain. This happens when all the following conditions are met:
540+
In some cases the `$domain` modifier can match not only the referrer domain, but also the target domain.
541541

542-
1. The request has the `document` content type
543-
1. The rule pattern does not match any particular domains
544-
1. The rule pattern does not contain regular expressions
545-
1. The `$domain` modifier contains only excluded domains, e.g. `$domain=~example.org|~example.com`
546-
547-
The following predicate should be satisfied to perform a target domain matching:
548-
549-
```text
550-
1 AND ((2 AND 3) OR 4)
551-
```
552-
553-
That is, if the modifier `$domain` contains only excluded domains, then the rule does not need to meet the second and third conditions to match the target domain against the modifier `$domain`.
554-
555-
If some of the conditions above are not met but the rule contains [`$cookie`](#cookie-modifier) or [`$csp`](#csp-modifier) modifier, the target domain will still be matched.
542+
If the rule contains [`$cookie`](#cookie-modifier) or [`$csp`](#csp-modifier) modifier, the target domain will be matched.
556543

557544
If the referrer matches a rule with `$domain` that explicitly excludes the referrer domain, then the rule will not be applied even if the target domain also matches the rule. This affects rules with [`$cookie`](#cookie-modifier) and [`$csp`](#csp-modifier) modifiers, too.
558545

559546
**Examples**
560547

561548
- `*$cookie,domain=example.org|example.com` will block cookies for all requests to and from `example.org` and `example.com`.
562-
- `*$document,domain=example.org|example.com` will block all requests to and from `example.org` and `example.com`.
549+
- `*$document,domain=example.org|example.com` will block all requests from `example.org` and `example.com` but not to them.
563550

564551
In the following examples it is implied that requests are sent from `http://example.org/page` (the referrer) and the target URL is `http://targetdomain.com/page`.
565552

566553
- `page$domain=example.org` will be matched, as it matches the referrer domain.
567-
- `page$domain=targetdomain.com` will be matched, as it matches the target domain and satisfies all requirements mentioned above.
554+
- `page$domain=targetdomain.com` will not be matched, as it matches the target domain but rule doesn't contain `$cookie` or `$csp` modifiers.
568555
- `||*page$domain=targetdomain.com` will not be matched, as the pattern `||*page` may match specific domains,
569556
e.g. `example.page`.
570557
- `||*page$domain=targetdomain.com,cookie` will be matched because the rule contains `$cookie` modifier

0 commit comments

Comments
 (0)