gorhill / uMatrix

uMatrix: Point and click matrix to filter net requests according to source, destination and type
GNU General Public License v3.0
4.56k stars 472 forks source link

[Feature Request] Common/DRY contexts/rulesets. #471

Closed xlevus closed 6 years ago

xlevus commented 8 years ago

tl;dr: It would be nice if you could save small groups of changes to a meta host.

Example: I visit a website with embedded youtube videos. Currently I can either apply rules to the global context and allow embedded video on every site, or I can apply the rules to all the sites each time I visit them.

Instead, if I could assign these rules to a 'meta' host (e.g. youtube-embed) that upon my next visit to a site that includes embedded videos, you can just enable the entire youtube-embed host.

0xBRM commented 8 years ago

This existed before and was called 'Recipes'. Gorhill removed it. I liked that feature, but I trust that it was removed for a reason.

gorhill commented 8 years ago

I removed it because it needed to be refactored -- it's issue #30. The refactoring is to make it possible for contributors to provide rulesets which can be imported by users, so that I do not have to maintain these myself.

Lunatrius commented 8 years ago

Wouldn't an editor similar to dashboard.html#user-rules work for this?

<meta-host> <host> <applies-to-what>
github-bundle github.com *
github-bundle githubapp.com *
github-bundle githubusercontent.com *
youtube-embed googlevideo.com *
youtube-embed youtube.com *
youtube-embed youtube.com frame
youtube-embed ytimg.com *
the8472 commented 8 years ago

Similar issue: https://github.com/gorhill/uMatrix/issues/393#issuecomment-156547112

It's basically a subproblem of the more general case that umatrix does not represent the hierarchy of loads well.

top level site -> frame -> script -> xhr top level site -> xhr

Those xhrs could go to to the same domain even though you would only want to allow the top level one but not the one in the frame or vice versa.

For youtube embeds you would want to allow top-level -> frame and frame -> googlevideo.com but not top-level -> googlevideo.com

gorhill commented 6 years ago

Duplicate of #30.