Skip to content

Feature request: Add $strict-{first,third}-party modifiers #3554

@ron-wolf

Description

@ron-wolf

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

AdGuard made plans to introduce this feature last December. It can be found described in their documentation12 as follows:

Click to expand

$strict-first-party

Works the same as the $~third-party modifier, but only treats the request as first-party if the referrer and origin have exactly the same hostname.

Examples

  • domain.com$strict-first-party — this rule applies only to domain.com. For example, a request from domain.com to http://domain.com/icon.ico is a first-party request. A request from sub.domain.com to http://domain.com/icon.ico is treated as a third-party one (as opposed to the $~third-party modifier).

Note
You can use a shorter name (alias) instead of using the full modifier name: $strict1p.

Compatibility
Rules with the $strict-first-party modifier are supported by AdGuard for Windows, AdGuard for Mac, and AdGuard for Android with CoreLibs v1.16 or later.

$strict-third-party

Works the same as the $third-party 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 (as opposed to the $third-party modifier).

Note
You can use a shorter name (alias) instead of using the full modifier name: $strict3p.

Compatibility
Rules with the $strict-third-party modifier are supported by AdGuard for Windows, AdGuard for Mac, and AdGuard for Android with CoreLibs v1.16 or later.

A specific URL where the issue occurs.

chrome-extension://cjpalhdlnbpafiamejdnhcphjbkeiagm/dashboard.html#1p-filters.html

Steps to Reproduce

  1. Open uBlock Origin settings
  2. Go to "My filters" tab
  3. Add a line with just *^$strict-first-party
  4. Click "✔ Apply changes" button

Expected behavior

The filter is applied.

Actual behavior

The $strict-first-party modifier is highlighted as an error:

The line of code given above in uBlock's static filter editor. Everything after the dollar sign has a translucent red highlight and a dotted red underline. Also, there is a red rectangle in the margin, to the right of the line number, which is 1.

uBO version

1.62.0

Browser name and version

Vivaldi 7.1.3570.54

Operating System and version

Windows 10 Version 22H2 (Build 19045.5487)

Footnotes

  1. https://adguard.com/kb/general/ad-filtering/create-own-filters/#strict-first-party-modifier

  2. https://adguard.com/kb/general/ad-filtering/create-own-filters/#strict-third-party-modifier

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfixedissue has been addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions