Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Support * * * [action] for dynamic filtering #682

Closed
gorhill opened this issue Feb 4, 2015 · 16 comments
Closed

Support * * * [action] for dynamic filtering #682

gorhill opened this issue Feb 4, 2015 · 16 comments

Comments

@gorhill
Copy link
Contributor

gorhill commented Feb 4, 2015

https://twitter.com/comex/status/562800585473544195:

* * * allow
* youtube.com * noop

The fix is very trivial, though I didn't go through thoroughly to see all the consequences, if any. But it worked as intended. Interesting use case, I didn't think about this being useful.

One could as well use:

* * * block

To block everywhere by default, which may also be sought after by many advanced users, as default-deny is a common mode for those using RequestPolicy and such.

@gorhill
Copy link
Contributor Author

gorhill commented Feb 4, 2015

Just for the record, the fix is different than what I suggested in my twitter answer: I had forgotten to take into account precedence logic. Still trivial though.

@mcdado
Copy link

mcdado commented Feb 4, 2015

Thanks, I will experiment it!

@gorhill gorhill closed this as completed in 77133b5 Feb 4, 2015
@gorhill
Copy link
Contributor Author

gorhill commented Feb 4, 2015

For Crowdin translators:

a

all means any type of resources from anywhere.

@gorhill
Copy link
Contributor Author

gorhill commented Feb 4, 2015

@mcdado Just in case it's not clear how to achieve "blacklist mode", these are the steps:

  • global allow all cell
    • "global" = 1st column
    • "allow" = green

c

Nothing will be blocked, static filtering is completely bypassed: "green" means "allow unconditionally".

To "blacklist" a site:

  • local noop all cell
    • "local" = 2nd column
    • "noop" = dark gray

This will cause the current site to become subjected to static filtering (EasyList, EasyPrivacy etc, i.e. whatever filter lists is in effect).

a

Dynamic filtering disengaged for current site: "gray" means disengage dynamic filtering, but apply static filtering.

In the screenshots above, 3rd-party frames are blocked to remind this is a good habit in general, and to illustrate that narrower dynamic rules prevails over more generic ones.

@gorhill
Copy link
Contributor Author

gorhill commented Feb 4, 2015

Similarly as above, to use uBlock's dynamic filtering in default-deny mode, it's just a matter of globally blocking the all cell, then to noop specific cells as needed (typically local cells).

Reminder: noop disengage dynamic filtering but keep static filtering engaged.

@mcdado
Copy link

mcdado commented Feb 5, 2015

So, if I were to manually edit the "My rules" list, it would look something like this right?

* * * allow
* * 3p-frame block
facebook.com * * noop
speedtest.net * * noop
spotify.com * * noop
youtube.com * * noop

Right now I cannot test it because I didn't figure out how (or whether it is possible) to compile the development version, so I have to wait for 0.8.7.0. As the reporter on Twitter says, it still blocks all sites.

@gorhill
Copy link
Contributor Author

gorhill commented Feb 6, 2015

Ok, I will create a bleeding edge "use-at-your-own-risk" dev version.

@gorhill
Copy link
Contributor Author

gorhill commented Feb 6, 2015

@gorhill
Copy link
Contributor Author

gorhill commented Feb 6, 2015

Also, be aware of issue #689.

@mcdado
Copy link

mcdado commented Feb 6, 2015

What I meant is that the guy on twitter that you linked to at the top of this issue said the same thing: as of 0.8.6, that type of configuration blocks all sites.

@mcdado
Copy link

mcdado commented Feb 6, 2015

I just tested it like so:

* * * allow
* * 3p-frame block
* youtube.com * noop
gazzetta.it * * noop
youtube.com * * noop

Ads are blocked on the specified sites (gazzetta.it and youtube.com) while are not blocked on a site such as smashingmagazine.com
This very unscientific test shows that it works as expected, embed youtube videos work thanks to * youtube.com * noop

@gorhill
Copy link
Contributor Author

gorhill commented Feb 7, 2015

I removed the all row in c9ef306.

It's just the UI counterpart I removed, * * * [allow|block|noop] is still supported.

The thinking is that the all row is very unlikely to be used by anyone: it makes little sense to block all, and for the blacklist mode, the rule * * * allow can be added manually, and once this is done, clicking the local setting of the 3rd-party row and the current site row will effectively engage static filtering for the current site.

The vertical space is precious and limited, so I decided to remove the all row given that it's very unlikely anyone will use it.

@Mikey1993
Copy link
Contributor

@gorhill can we then get back the domains connected count back? :)

@chrisaljoudi
Copy link
Contributor

@Mikey1993 it is back.

Domain count

@Mikey1993
Copy link
Contributor

@chrisaljoudi Oh, this is per page, not global stats?
Sorry, I was a bit lazy downloading the dev version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants