Skip to content

Conversation

workingBanana
Copy link

@workingBanana workingBanana commented Apr 4, 2025

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.
Target CoreLibs version is 1.18

Copy link

github-actions bot commented Apr 4, 2025

Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/

@sfionov
Copy link
Member

sfionov commented Apr 11, 2025

@workingBanana We need to retain info about deprecated behavior, but note that since CoreLibs 1.18 logic is simplified. Examples should mention both cases, though.

Copy link
Member

@sfionov sfionov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented separately

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 link

Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/

Copy link

github-actions bot commented May 5, 2025

Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/

Copy link

Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/

Copy link
Member

@sfionov sfionov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add $removeparam

Copy link

Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/

@sfionov sfionov self-requested a review August 12, 2025 07:38
Copy link
Member

@sfionov sfionov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Copy link

Preview was deployed to: https://pull-request-677.kb-adg.pages.dev/

@sfionov sfionov requested a review from el-termikael August 12, 2025 18:30

**Examples**

- `*$cookie,domain=example.org|example.com` will block cookies for all requests to and from `example.org` and `example.com`.
- `*$document,domain=example.org|example.com` will block all requests to and from `example.org` and `example.com`.
- `*$document,domain=example.org|example.com` will block requests only from `example.org` and `example.com` but not to them.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `*$document,domain=example.org|example.com` will block requests only from `example.org` and `example.com` but not to them.
- `*$document,domain=example.org|example.com` will block requests only from `example.org` and `example.com`, but not to them.

- `page$domain=targetdomain.com` will be matched, as it matches the target domain and satisfies all requirements mentioned above.
- `||*page$domain=targetdomain.com` will not be matched, as the pattern `||*page` may match specific domains,
e.g. `example.page`.
- `page$domain=targetdomain.com` will not be matched, as it does not match referrer domain.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `page$domain=targetdomain.com` will not be matched, as it does not match referrer domain.
- `page$domain=targetdomain.com` will not be matched because it does not match the referrer domain.

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.

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.
For these modifiers, 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For these modifiers, 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.
These modifiers will not be applied if the referrer matches a rule with `$domain` that explicitly excludes the referrer domain, even if the target domain also matches the rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants