Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 2.24 KB

README.rst

File metadata and controls

59 lines (40 loc) · 2.24 KB

umatrix2ublock

Migrate rulesets from uMatrix to uBlock-Origin.

Warning

Websites are very likely to break with this setup, so have uBlock-Origin disabled in private windows such that you have a fallback option.

An effort is made to retain similar functionality and blocking as before.

Usage

  1. Opt-in under uBlock-Origin settings: "I am an advanced user". Then block 3rd-party scripts and frames globally. Alternatively block only 3rd-party frames (less breakage).

    https://user-images.githubusercontent.com/9155111/75366608-44884300-58bf-11ea-88ff-8ca3252fd763.png
  2. Either enable "Custom" Firefox Enhanced Tracking protection to block all third-party cookies, or use Cookie-AutoDelete.

  3. Export your existing uMatrix and uBlock-Origin rules into text files. Execute it something similar to:

    cd examples/
    python ../umatrix2ublock.py my-umatrix-rules.txt my-ublock-dynamic-rules_2020-02-26_14.07.25.txt
    

    to obtain a merged ruleset my-ublock-dynamic-rules.txt compatible with uBlock-Origin.

  4. Import the merged ruleset into uBlock-Origin.

Background

In my browser, I originally had uBlock-Origin (with its default settings) and uMatrix.

I started using uMatrix to block all third-party requests by default (except css and images), and whitelisting a few requests to make the website is functional.

https://user-images.githubusercontent.com/585534/33213085-ff74afd8-d0f3-11e7-8232-4c204925d274.png

I realized later that most of the time, I was just whitelisting scripts and XHRs. Which meant in principle, I can rely on custom settings as mentioned above. I simply needed to migrate my uMatrix rules that I had aggregated over several months to serve the same purpose.