AdguardTeam / AdguardBrowserExtension

AdGuard browser extension

Home Page:https://adguard.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Domain restrictions semantics

ameshkov opened this issue · comments

If the following conditions are true:

  • pattern === ANY_URL
  • domain resriction is not empty
  • resource type ===(SUB)DOCUMENT

Then use the host of the request URL to check domain restrictions.

Test rules:

  • $csp=script-src 'none',domain=example.org
  • $cookie=test,domain=example.org
In the case when there's no "source" hostname, `$domain` should be checked against the request's host.

Currently, we have a workaround for rules with empty pattern and a domain restriction (i.e. $cookie,domain=yandex.ru). We won't need it anymore if we implement this change.