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

[Desktop] Support denyallow adblock rules #10462

Open
antonok-edm opened this issue Jun 24, 2020 · 0 comments · Fixed by brave/adblock-lists#403
Open

[Desktop] Support denyallow adblock rules #10462

antonok-edm opened this issue Jun 24, 2020 · 0 comments · Fixed by brave/adblock-lists#403
Assignees
Labels
dev-concern feature/shields/adblock Blocking ads & trackers with Shields OS/Desktop

Comments

@antonok-edm
Copy link
Contributor

uBlock Origin introduced the denyallow option for network filters in 1.25.3b4, as noted in the static filter syntax documentation.

The purpose of denyallow is bring default-deny/allow-exceptionally ability into static network filtering arsenal.

Example:

*$3p,script,denyallow=x.com|y.com,domain=a.com|b.com

The above filter tells the network filtering engine that when the context is a.com or b.com, block all 3rd-party scripts except those from x.com and y.com.

Essentially, the new denyallow option makes it easier to implement default-deny/allow-exceptionally in static filter lists, whereas before this had to be done with unwieldy regular expressions[1], or through the mix of broadly blocking filters along with exception filters[2].

[1] hg.adblockplus.org/ruadlist/rev/f362910bc9a0

[2] Typically filters which pattern are of the form |http*://

As of the time of this issue this syntax is already used in at least one rule at https://github.com/uBlockOrigin/uAssets/blob/3607fd8adf53104fc22c84c52dc495fb74b41864/filters/filters-2020.txt#L2410:
*$3p,script,domain=boards.4channel.org,denyallow=4cdn.org|4chan.org|google.com|gstatic.com|cdn.mathjax.org|cdnjs.cloudflare.com|hcaptcha.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-concern feature/shields/adblock Blocking ads & trackers with Shields OS/Desktop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants