Using personal ruleset recipes in uMatrix in Firefox
But it turns out that we can do better. uMatrix has a thing called ruleset recipes, which are, to quote it:
Ruleset recipes ("recipes" thereafter) are community-contributed rulesets suggested to you when you visit a given web site. Recipes are specific, they contain only the necessary rules to un-break a specific web site or behavior.
There is no community contributed recipe for Medium that I know of, but we can write our own and hook it into uMatrix, provided that we have a website somewhere. Once added to uMatrix, we can enable it temporarily with a couple of clicks and then dump all of its temporary additions later.
First we need to create a text file with the rulesets we want and the necessary rules in them. For my Medium rules, what we need looks like this:
$ cat recipes_cks_en.txt ! uMatrix: Ruleset recipes 1.0 ! Title: Chris's additional rulesets for English websites ! Maintainer: Chris Siebenmann ! Medium no account medium.com * _ 1st-party script _ gist.github.com script
Next we need to put this on a website somewhere. Generally this should be a HTTPS website that you trust, for safety. Having done this we next need to add our recipes URL to uMatrix. This is done by going to the uMatrix dashboard, going to the Assets tab, and then down at the bottom of the 'Ruleset recipes' section you will see an 'Import...' option. Enable it, enter the URL of your recipes, and click 'Apply changes'. There, you're done; your new recipes are now available through uMatrix's regular interface for them, described in the ruleset recipes wiki page.
(You can also see the built in recipes in the Assets tab, or look at them on Github. This will give you an idea of what you can do in your own recipes.)
PS: I haven't tried to contribute my Medium recipe because I have no idea if it's complete or truly good enough. It works for me for the things that I care about, more or less, but I don't care very much about having all of Medium's various peculiarities working correctly (or correctly being blocked).