The Wayback Machine - https://web.archive.org/web/20211024183117/https://github.com/gorhill/uBlock/issues/1748
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

[Non-issue/Minor issue] Dynamic filtering precedence confusion #1748

Open
scratchyleet opened this issue Jun 23, 2016 · 9 comments
Open

[Non-issue/Minor issue] Dynamic filtering precedence confusion #1748

scratchyleet opened this issue Jun 23, 2016 · 9 comments

Comments

@scratchyleet
Copy link

@scratchyleet scratchyleet commented Jun 23, 2016

Requirements:

  • Firefox 46.0.1.
  • uBlock Origin 1.7.6.

Reproducing steps:

  • Set dynamic filter with rules below:
* * 3p block
addons.mozilla.org * image noop
  • Open logger.
  • Open page https://addons.mozilla.org/
  • Watch in the logger as images are being blocked yet rule addons.mozilla.org * image noop is present in a dynamic filter.

Additional information:
I do realize that 3p has a precedence over an image type but it is a bit confusing. Since addons.mozilla.org * image noop rule does coexist in a dynamic filter with * * 3p block. Although in my opinion * * 3p block is being less specific than addons.mozilla.org * image noop. An intended behavior?

Good luck fixing that.

@gorhill
Copy link
Owner

@gorhill gorhill commented Jun 23, 2016

* * 3p block is being less specific than addons.mozilla.org * image noop

The cell at addons.mozilla.org * 3p evaluates to block.

If this really confuses a majority of users, I will just remove the ability to create block rules for images. The primary purpose of image rules was to save bandwidth, while more recent versions of uBO can block images based on size.

@scratchyleet
Copy link
Author

@scratchyleet scratchyleet commented Jun 23, 2016

If it really confuse a majority of users, I will just remove the ability to create block rules for images.

I guess that is not really required though it would be nice to add/update examples at:
https://github.com/gorhill/uBlock/wiki/Dynamic-filtering:-precedence

For example:
What is that?

The more specific the party, the higher the precedence.

  • example.com overrides 1rd-party scripts

Is that 1st-party scripts or 3rd-party scripts?

Also a statement:

All cells override the all cells.

implies that a below dynamic filter rule would not work?

* * 3p block
addons.mozilla.org * * noop

This one is confusing too since it is present in the rules but does not work.

Edit:
https://github.com/gorhill/uBlock/wiki/Behind-the-scene-network-requests

If there are only very specific behind-the-scene network requests you would like to filter, a good approach to minimize potential problems is to use dynamic filtering: set a local rule for the all cell to allow (green) (i.e. behind-the-scene * * allow). This will ensure nothing is blocked in the behind-the-scene scope, just as if uBlock is disabled for that scope. Then create block rules for the specific hostnames for which you want to block all network requests, or noop if you want to subject those hostnames to static filtering only.

It seems 3p overrides that too?

* * 3p block
behind-the-scene * * allow

Still blocks behind-the-scene requests. Despite:

This will ensure nothing is blocked in the behind-the-scene scope, just as if uBlock is disabled for that scope.

@Blaisorblade
Copy link

@Blaisorblade Blaisorblade commented Oct 17, 2016

I have a similar/the same problem. I left a Medium article open, and noticed uBlock blocked ~300k requests, so I investigated. Turns out that the webpage connects to collector-medium.lightstep.com periodically, EasyPrivacy blocks that, and since lightstep seems just performance monitoring, I tried to re-enable it.

First I tried various dynamic rules, ending up with the following permanent dynamic rule:

* collector-medium.lightstep.com * allow

The docs seem pretty clear this rule should override the static ones, but that doesn't work.
EDIT: the static filter rule from EasyPrivacy is:

||collector-medium.lightstep.com^
@gorhill
Copy link
Owner

@gorhill gorhill commented Oct 17, 2016

The docs seem pretty clear this rule should override the static ones

Your rule works fine here. Did you enable Advanced user mode?

@Blaisorblade
Copy link

@Blaisorblade Blaisorblade commented Oct 17, 2016

@gorhill You're right, I didn't and that fixed it, but the UI/docs doesn't tell me to in places I looked at.

The "My rules" settings page is shown without that enabled, and neither that settings page nor the page linked at "full documentation" (https://github.com/gorhill/uBlock/wiki/Dynamic-filtering:-rule-syntax) dynamic page mentions it. (I didn't find an edit button for the wiki, so I'm afraid some contributor will have to fix it). Would you like a separate issue for that?

@gorhill
Copy link
Owner

@gorhill gorhill commented Oct 17, 2016

Would you like a separate issue for that?

No. This is a sub page on the whole topic -- go back to the main page and it's clearly mentioned.

@Blaisorblade
Copy link

@Blaisorblade Blaisorblade commented Oct 17, 2016

Could I then suggest linking to https://github.com/gorhill/uBlock/wiki/Dynamic-filtering instead?

(I'd also say the Dynamic filtering page should at least have a warning if it's disabled, to be a bit more usable, but changing the link is easier and would make things much better).

@gorhill
Copy link
Owner

@gorhill gorhill commented Oct 17, 2016

Could I then suggest linking to https://github.com/gorhill/uBlock/wiki/Dynamic-filtering instead?

It does already link back, that's what I pointed out in my answer above.

@gorhill
Copy link
Owner

@gorhill gorhill commented Oct 17, 2016

Ok I see, you mean from the dashboard of uBO itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants