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

correctly handle domain + subdomain options when one is negated #5

Closed
AndriusA opened this issue Apr 15, 2019 · 3 comments · Fixed by #7
Closed

correctly handle domain + subdomain options when one is negated #5

AndriusA opened this issue Apr 15, 2019 · 3 comments · Fixed by #7
Labels
bug Something isn't working

Comments

@AndriusA
Copy link
Contributor

Examples:

adv$domain=example.com|~foo.example.com should match:

  • url http://example.net/adv from source http://example.com

but not match:

  • url http://example.net/adv from source http://foo.example.com
  • url http://example.net/adv", from source http://www.foo.example.com

adv$domain=~example.com|foo.example.com should match:

  • url http://example.net/adv from source http://foo.example.com
  • url http://example.net/adv", from source http://www.foo.example.com

but not match:

  • url http://example.net/adv from source http://example.com
@AndriusA
Copy link
Contributor Author

AndriusA commented May 8, 2019

Decided the current handling of looking at eTLD+1 is not correct and need to implement proper subsetting

@AndriusA AndriusA reopened this May 8, 2019
@bbondy
Copy link
Member

bbondy commented May 8, 2019

Just making sure, eTLD+1 should still be used for source tab and primary URL comparisons for the $third-party option, but subdomain is for domain=

@AndriusA
Copy link
Contributor Author

AndriusA commented May 8, 2019

Updated example checked against uBlock Origin:

  • adv$domain=example.com|~foo.example.com blocks when source = example.com or bar.example.com but not foo.example.com or anotherexample.com
  • adv$domain=~example.com|~foo.example.com passes for source = example.com, bar.example.com and foo.example.com but blocks for anotherexample.com
  • adv$domain=example.com|foo.example.com blocks for source = example.com, bar.example.com and foo.example.com but passes for anotherexample.com
  • adv$domain=~example.com|foo.example.com passes for all 4

AndriusA pushed a commit that referenced this issue May 8, 2019
…bsetting cases, mirroring uBlock Origin behaviour.

I.e. in the case of filter `adv$domain=~example.com|foo.example.com` and request URL = `http://example.net/adv` it does not match when issued from:

- http://example.com
- http://foo.example.com
- http://subfoo.foo.example.com
- http://bar.example.com
- http://anotherexample.com

Closes #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants