Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description for strict-first-party and strict-third-party modifiers #517

Merged
merged 10 commits into from
Aug 20, 2024
32 changes: 32 additions & 0 deletions docs/general/ad-filtering/create-own-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ Basically, they just limit the scope of rule application.
| [$match-case](#match-case-modifier) | ✅ | ✅ | ✅ | ⏳ | ⏳ | ✅ |
| [$method](#method-modifier) | ⏳ | ✅ | ✅ | ❌ | ❌ | ❌ |
| [$popup](#popup-modifier) | ✅ * | ✅ | ✅ | ✅ * | ✅ * | ❌ |
| [$strict-first-party](#strict-first-party-modifier) | ⏳ | ❌ | ❌ | ❌ | ❌ | ❌ |
| [$strict-third-party](#strict-third-party-modifier) | ⏳ | ❌ | ❌ | ❌ | ❌ | ❌ |
| [$third-party](#third-party-modifier) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [$to](#to-modifier) | ⏳ | ✅ | ✅ | ❌ | ❌ | ❌ |

Expand Down Expand Up @@ -578,6 +580,34 @@ AdGuard will try to close the browser tab with any address that matches a blocki

:::

#### **`$strict-first-party`** {#strict-first-party-modifier}

Works the same as the [`$~third-party`](#third-party-modifier) modifier but treats the request as first-party only if the refferer and the origin share exactly the same hostname.
anyakushin marked this conversation as resolved.
Show resolved Hide resolved

**Examples**

- `||domain.com$strict-first-party` — this rule is applied exclusively to `domain.com`. For example a request from `domain.com` to `http://domain.com/icon.ico` is a first-party request. Request from `sub.domain.com` to `http://domain.com/icon.ico` is treated as a third-party (unlike the `$~third-party` modifier).
anyakushin marked this conversation as resolved.
Show resolved Hide resolved

:::note

You may use a shorter name (alias) instead of using the full modifier name: `$strict1p`.
anyakushin marked this conversation as resolved.
Show resolved Hide resolved

:::

anyakushin marked this conversation as resolved.
Show resolved Hide resolved
#### **`$strict-third-party`** {#strict-third-party-modifier}

Works the same as the [`$third-party`](#third-party-modifier) modifier but also treats requests from the domain to its subdomains and vice versa as third-party requests.

**Examples**

- `||domain.com^$strict-third-party` — this rule applies to all domains, except `domain.com`. An example of a third-party request: `http://sub.domain.com/banner.jpg` (unlike the `$third-party` modifier).
anyakushin marked this conversation as resolved.
Show resolved Hide resolved

:::note

You may use a shorter name (alias) instead of using the full modifier name: `$strict3p`.
anyakushin marked this conversation as resolved.
Show resolved Hide resolved

:::

#### **`$third-party`** {#third-party-modifier}

A restriction of third-party and own requests. A third-party request is a request from a different domain. For example, a request to `example.org` from `domain.com` is a third-party request.
anyakushin marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -2586,6 +2616,8 @@ Modifier aliases (`1p`, `3p`, etc.) are not included in these categories, howeve
- [`$domain`](#domain-modifier) with negated domains using `~`,
- [`$match-case`](#match-case-modifier),
- [`$method`](#method-modifier) with negated methods using `~`,
- [`$strict-first-party`](#strict-first-party-modifier),
- [`$strict-third-party`](#strict-third-party-modifier),
- [`$third-party`](#third-party-modifier),
- [`$to`](#to-modifier),
- restricted [content-types](#content-type-modifiers) with `~`.
Expand Down
Loading