gorhill / uMatrix

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

Submit My Third-Party Rules #979

Open Riajyuu opened 6 years ago

Riajyuu commented 6 years ago

I'm sorry that the title is a bit confusing. If there is any requirement for this to be accepted, I will try to fix that asap.

Plus, I promise to keep it alive in a predictable future as those rules target websites worldwide.

zippy5 commented 6 years ago

@Rictusempra, would you consider adding/converting these as recipes as well? I think they would be a great addition to that :)

More info:

https://github.com/gorhill/uMatrix/wiki/Contributing-ruleset-recipes

https://github.com/gorhill/uMatrix/releases

Riajyuu commented 6 years ago

@zippy5

would you consider adding/converting these as recipes as well?

What did you suppose to mean exactly? If you are talking about samples in uMatrix wiki, there isn't too much I can do.

zippy5 commented 6 years ago

Hi @Rictusempra, it's a fairly new feature that's been added to uMatrix. From the release page:

[Status: experimental] A new button ("puzzle" piece icon) is available in the popup panel: uMatrix will offer you the ability to import community-contributed ruleset recipes which are relevant to the current page (see #30). Hopefully there will be many contributions to populate ruleset recipes ready to be used to unbreak sites.

Instead of being added as a filter list, they're "recipes" that you can toggle on from the puzzle piece icon within the uM popup. They are added as temporary rules, so each user can use it to quickly unbreak a site, but they can also be quickly modified via the UI and then made permanent or erased via the eraser/lock buttons.

Here's the current recipes available:

https://github.com/uBlockOrigin/uAssets/blob/master/recipes/recipes_en.txt

Riajyuu commented 6 years ago

Instead of being added as a filter list, they're"recipes" that you can toggle on from the puzzle piece icon within the uM popup.

~Well, isn't that what this PR doing exactly?~

image

~You can also confirm that via the given supportURL~

My bad. There was a strange mistake. Sorry for that. CC @gorhill

zippy5 commented 6 years ago

I could be mistaken, but...

to me it looks like you're trying to import them as "recipes," but the content found at

https://raw.githubusercontent.com/uMatrix-Rules/uMatrix-Rules-Domain/master/rules.txt

are in the format of filters, not the syntax for recipes.

Riajyuu commented 6 years ago

hmmmmmmm, that is, frankly, an insanely huge amount of work.

But I will try that.

@gorhill I need your words here. If you wish to see those rules converted into recipes, I will try that. If not, perhaps leave them like that as rules.

gorhill commented 6 years ago

If you want to submit recipes for inclusion in official built-in recipes, please submit them one by one, such that each can be inspected/validated by everyone. Also, I see you have Chinese sites in there, these should be in their own file -- this means a new CHN recipes resource would need to be created.

I still need to add documentation about how recipes should be crafted, I didn't have the time yet.

Riajyuu commented 6 years ago

@gorhill thanks for the reply. I will try whatever I can do. I still have two questions:

  1. how to allow resources globally, specifically some CDN scripts library? You can find that in my rules files.
  2. how to fit scope level? You can see the two repositories for the corresponding two scope levels of umatrix.
gorhill commented 6 years ago

I am going to write some documentation and come back when done.

gorhill commented 6 years ago

This is what I have now: https://github.com/gorhill/uMatrix/wiki/Ruleset-recipes. Consider this a first draft, I will edit according to feedback.

Something I forgot to mention, there is a yet-to-be-documented advanced setting to make it easy to road-test recipes: set contributorMode to true in the More pane, this will add a widget in the Assets pane which purpose is to add inline recipes -- "My recipes".

Riajyuu commented 6 years ago

Consider this a first draft, I will edit according to feedback.

Great, gratefully thx for your time, @gorhill . I will try to craft something.

Plus, as a solution for scope-level fitting, here is what I suggested:

"umatrix-rules": {
  "content":"recipes",
  "title": "uMatrix Rules (Third-Party Contributed)",
  "scopeLevel": "domain",
  "contentURL": "https://raw.githubusercontent.com/uMatrix-Rules/uMatrix-Rules-Domain/master/rules.txt",
  "supportURL": "https://umatrix-rules.github.io"
}

If not specific, occurs at every level for subscription. If specific, occurs (& effective) only when uMatrix is set to the the targeted scope level.