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

Add noop option to static filters #1365

Closed
flyingzebras opened this issue Feb 11, 2016 · 10 comments
Closed

Add noop option to static filters #1365

flyingzebras opened this issue Feb 11, 2016 · 10 comments
Labels

Comments

@flyingzebras
Copy link

flyingzebras commented Feb 11, 2016

This issue only make sense if 3rd party rules (subscription rules) ever become implemented.

"For phncdn.com we are only adding specific scripts to whitelist because their sites are know to misuse it for serving ads." - MonztA (EasyList author)

In this filter we need to noop pornhub.com (and all domains), and the white list domains (phncdn.com, etc), so EasyList can take care of them.

In uBO there is option important for static syntax which is used to override filters, but there are no [noop] (https://github.com/gorhill/uBlock/wiki/Dynamic-filtering:-quick-guide) (contrary to the dynamic filter syntax) that can be used to make transparent filters.

Can you please add it?

@flyingzebras
Copy link
Author

@gorhill Why?

@gorhill
Copy link
Owner

gorhill commented Feb 11, 2016

Because I don't know what you are trying to accomplish. The first thing to point out is what exactly is the primary, root issue.

@flyingzebras
Copy link
Author

Valid static filters equivalent to dynamic filters

www.pornhub.com * * block
www.pornhub.com phncdn.com * allow
www.pornhub.com pornhub.com * allow

corresponds to these static filters:

*$third-party,domain=pornhub.com
@@||phncdn.com

Missing static filters equivalent to dynamic filters

www.pornhub.com * * block
www.pornhub.com phncdn.com * noop
www.pornhub.com pornhub.com * noop

corresponds to which static filters?

@flyingzebras flyingzebras changed the title Add noop syntax to static filters Add noop option to static filters Feb 11, 2016
@flyingzebras
Copy link
Author

@IDKwhattoputhere Please have a look on this issue.

@gorhill
Copy link
Owner

gorhill commented Feb 11, 2016

I want

Just use dynamic filtering, that's an excellent case to justify using dynamic filtering.

noop makes no sense here, you are assuming custom filters are treated in a different layer than 3rd-party filter lists: it's not the case, static filters are all handled in the same layer, regardless of whether they are custom or 3rd-party.

@gorhill gorhill closed this as completed Feb 11, 2016
@flyingzebras
Copy link
Author

@gorhill

noop makes no sense here, you are assuming custom filters are treated in a different layer than 3rd-party filter lists.

No I do not. I'm just saying that there are no options to do this with static filters:

www.pornhub.com * * block
www.pornhub.com phncdn.com * noop
www.pornhub.com pornhub.com * noop

I wish it would be possible because then such filter could be added to 3rd-party filters -> uBlock filters so everyone could make use of it!

@gorhill
Copy link
Owner

gorhill commented Feb 11, 2016

No I do not.

I can't understand this for you, you need to understand it yourself why it makes no sense. It will probably dawn on you if you try to resolve this riddle, which you raised when you asked

corresponds to which static filters?

Push your investigation further and make your full proposal of how the static filtering engine would work to implement your idea of noop option for static filters. "Full proposal" means you actually go through detailing how the static filtering engine will handle such filter option. This is the bird view of how the static filtering engine currently works:

  • If a block filter pattern-matches:
    • If the filter is important:
      • return blocked.
    • If an exception filter pattern-matches:
      • return not-blocked.
    • return blocked.

"Noop" in the dynamic filtering engine means "abort dynamic filtering". So "noop" in the static filtering engine would also be "abort static filtering", which means "do not block the network request", because there is no other filtering layer below static filtering.

@lewisje
Copy link

lewisje commented Feb 11, 2016

For custom filters, that option exists already, and it's called prepending with the ! character.

@flyingzebras
Copy link
Author

@gorhill

"Noop" in the dynamic filtering engine means "abort dynamic filtering". So "noop" in the static filtering engine would also be "abort static filtering", which means "do not block the network request", because there is no other filtering layer below static filtering.

Thank you for the Overview of uBlock's network filtering engine link, but it doesn't explain one thing; Are the filters applied exactly in the same order as they are listed in 3rd-party filters (eg are uBlock filters applied before EasyList)?

@lewisje
Copy link

lewisje commented Feb 12, 2016

I don't believe order matters: Filters are applied based on priority, and there's no way for filters at the same priority level to override each other (for example, a static blocking filter without important cannot keep another static blocking filter without important from working; a static whitelist rule can do that, but only because static whitelist rules have higher priority).

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

No branches or pull requests

3 participants