You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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]>
Copy file name to clipboardExpand all lines: docs/general/ad-filtering/create-own-filters.md
+4-17
Original file line number
Diff line number
Diff line change
@@ -537,34 +537,21 @@ If you want the rule not to be applied to certain domains, start a domain name w
537
537
538
538
**`$domain` modifier matching target domain:**
539
539
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.
541
541
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.
556
543
557
544
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.
558
545
559
546
**Examples**
560
547
561
548
-`*$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.
563
550
564
551
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`.
565
552
566
553
-`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.
568
555
-`||*page$domain=targetdomain.com` will not be matched, as the pattern `||*page` may match specific domains,
569
556
e.g. `example.page`.
570
557
-`||*page$domain=targetdomain.com,cookie` will be matched because the rule contains `$cookie` modifier
0 commit comments