Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

[Request] Group similar rules with different types into a single rule with many types #825

Open
zero77 opened this issue Nov 21, 2017 · 12 comments

Comments

@zero77
Copy link

zero77 commented Nov 21, 2017

To keep the “my rules” page tidy is it possible to have more than one request type per rule.
google.com google.com xhr,frame,other allow
thanks

@gorhill
Copy link
Owner

gorhill commented Nov 21, 2017

Please provide sensible title to issue you open, these are used for others to lookup issues, and it helps by not burdening me with the task of having to edit your issue. Is the following excerpt not clear in CONTRIBUTING?

you benefit from the carefully crafted code, return the favor by carefully crafting issues/bug reports.

@gorhill gorhill changed the title Question [Request] Group similar rules with different types into a single rule with many types Nov 21, 2017
@zero77
Copy link
Author

zero77 commented Nov 21, 2017

Apologies, I will take this into consideration in the future.

@elypter
Copy link

elypter commented Nov 24, 2017

this makes things a little more complicated syntax wise because then multiple ways of writing rules exist but it makes the list a lot smaller. what i think that would be even more effient if you go that route would be meta rules like "all-except-cookies" or "video-frame" which is basically a generic row that can be applied to any domain you like and that can be changed globally. if umatrix one day become more fine grained this could prove handy. they would be defined with a directive and can then be used like regular request types.

@gorhill
Copy link
Owner

gorhill commented Nov 24, 2017

Rules have to map to src des type action internally, this won't change, this is essentially uMatrix at its core. The suggestion here translate very well back and forth to uMatrix's internal syntax. Anything else that does not translate well into src des type action won't work and will just make the code unduly complicated -- not a good thing for stability.

@elypter
Copy link

elypter commented Nov 24, 2017

this would still have the same syntax. just more keywords for type. for example:

yahoo.com search.yahoo.com except-cookies allow

this would allow every request on yahoo.com to search.yahoo.com except cookies

for this to work you would have to add a new directive:
custom-type: type-name type action

for example:
custom-type: except-cookie * allow
custom-type: except-cookie cookie block

this could even be expanded for a whole scope by adding destinations to the syntax. this way you could reuse a ruleset made for one website for another or make templates for general types of websites and only adjust whats different between them. for example to allow embedded youtube videos easily on a set of sites without having to allow google globally. this would also be useful to temporarily unbreak sites like suggested here(point 2) https://discourse.mozilla.org/t/support-umatrix/5131/34 and it could also be used to give the host lists a different default behavior

template: type-name des type action

for example:
template: except-cookie 1st-party * allow
template: except-cookie * cookie block
template: except-cookie 1st-party cookie block

i dont know if it is really needed and its a big change but i think if that if the syntax should be extended this would be a good and flexible way.

@zero77
Copy link
Author

zero77 commented Nov 28, 2017

I was thinking of something along the lines of:

google.com mail.google.com cookie,xhr,other allow

@ArchangeGabriel
Copy link

Yeah, the idea is that the type field could be a list of comma separated types instead of only one.

@zero77
Copy link
Author

zero77 commented Nov 28, 2017

@ArchangeGabriel
yes, exactly.

@gorhill
Copy link
Owner

gorhill commented Nov 28, 2017

I was thinking of something along the lines of:

That was my understanding of your suggestion, and what I was planning to do, including keeping the types ordered as per current order in the matrix UI.

@zero77
Copy link
Author

zero77 commented Nov 28, 2017

@gorhill
thanks.

@mikhaelkh
Copy link
Contributor

mikhaelkh commented Dec 29, 2017

As I see it, the main goal of this request is to make "My rules" tab easier to work with.
But grouping is not the best way to make it happen. Also, it complicates the implementation of my ideas.
I think the best ways of improving usability are:

  1. Search. Hide rules that doesn't contain given string (or doesn't match regexp).
  2. Diff. Hide the same rules in Permanent and Temporary halves. Useful to review what you've changed before closing the browser.

@zero77
Copy link
Author

zero77 commented Jan 3, 2018

That’s a good idea but it’s not really what I was after in this request.
I like the my rules tab and I find it easy to work with.

But, I am finding its getting a bit messy as I have lots of rules and in particular multiple rules for the same domains.

So I think combining rules for the same domain would solve this and make the my rules tab a lot neater and easer to work with as a result.

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

5 participants