How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Post your tutorials for using applications or performing related tasks here.
Note: Not for "how do I...?" Questions!
Forum rules
Tutorials and Howtos should only relate to developed software, and not to third party applications. e.g.: Don't post a generic Howto for configuring a firewall.
If you have a question how to do something, you should use one of the support boards, not this board. It is meant for people to document and post instructions.
User avatar
gracious1
Keeps coming back
Keeps coming back
Posts: 891
Joined: 2016-05-15, 05:00
Location: humid upstate NY

How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by gracious1 » 2017-12-05, 11:56

How to install uMatrix in Pale Moon 27 for GNU/Linux (Ubuntu)

Recently Raymond Hill ceased to release XUL builds of uMatrix to github for installation. However, all is not lost for Pale Moon users. The XUL source code has not been removed from the repository; therefore, it is possible to create your own build. In this tutorial, I am using Ubuntu, although it will work in just about any GNU/Linux distro.
  1. Open Terminal
  2. Make sure you have the Python Programming Language (python3) installed.
    1. Enter this command:

      Code: Select all

      dpkg-query -W -f='${Status} ${Version}\n' python3
      If you have it installed this is your output:

      Code: Select all

      install ok installed <version>
      The <version> will be a string, such as 3.4.0-0ubuntu2 if you are using Ubuntu.
    2. If you do not see that output, install python3, like so:

      Code: Select all

      sudo apt-get update && sudo apt-get install python3
      (Enter 'y' when prompted).
  3. Now we get down to the nuts and bolts: building the cross-platform installer module (XPI), also called a "bundle".
    1. Make sure you are in your home directory.

      Code: Select all

      cd ~
    2. Clone the uMatrix repository at Github.com into a newly created directory in your home directory.

      Code: Select all

      git clone https://github.com/gorhill/uMatrix.git
      This creates a directory called uMatrix, filled with the sources you need.
    3. Enter the new uMatrix directory.

      Code: Select all

      cd ~/uMatrix
    4. Okay, let's build this bundle!! Enter this command:

      Code: Select all

      tools/make-firefox.sh all
      Now there is an XPI module ready to be installed, with this path:

      Code: Select all

      ~/uMatrix/dist/build/uMatrix.firefox.xpi
  4. At last, we install uMatrix into Pale Moon.
    1. In Add-ons Manager in Pale Moon, pull down the gear menu and select "Install Add-on From File".
    2. Navigate to the uMatrix.firefox.xpi file, following the above path, and select it.
  5. Now look in the Extensions list in your Add-ons Manager. You should see uMatrix installed with the beloved Blue Dot. :thumbup:
    Image
Now you are ready to use uMatrix.
Nice work! :clap:

P.S. An alternative to step 4: In your graphic file manager, drag and drop uMatrix.firefox.xpi onto Pale Moon.

Special thanks to ketana. :geek:
20 July 1969 🌗 Apollo 11 🌓 "One small step for [a] man, one giant leap for mankind." 🚀

User avatar
jars_
Lunatic
Lunatic
Posts: 397
Joined: 2016-12-27, 00:12

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by jars_ » 2017-12-06, 06:02

What about windows users? no bat\cmd in package. I must to rewrite make-firefox.sh to cmd\bat format, right?

adisib
Lunatic
Lunatic
Posts: 380
Joined: 2015-06-13, 03:34
Location: KY

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by adisib » 2017-12-06, 06:39

jars_ wrote:I must to rewrite make-firefox.sh to cmd\bat format, right?
If you don't want to rewrite it or have someone else rewrite it, you run shell scripts in the Linux Subsystem for Windows 10 or Cygwin for any version of Windows, or run it in real Linux by temporarily booting into a live usb.

User avatar
jars_
Lunatic
Lunatic
Posts: 397
Joined: 2016-12-27, 00:12

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by jars_ » 2017-12-06, 07:44

OK, i forget, that i have UnixUtils(Cygwin) installed :) Everything worked out.
Thanks for instruction.

ghysler

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ghysler » 2017-12-09, 22:02

Awesome. Thank you very much for the detailed instructions! (my favorite add-on, for sure)

Note: it might be wise to use the source code for the latest release instead - links at https://github.com/gorhill/uMatrix/releases
Otherwise you will most likely end up with a pre-release build.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2358
Joined: 2012-08-19, 20:32

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by back2themoon » 2017-12-09, 22:45

Thanks for the guide gracious1. It'd be really nice if we could have a similar Windows guide "for dummies"... I'm seeing the references to Subsystem/Cygwin/LiveUSB, perhaps I might try something like that.

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by MoonSavvy » 2017-12-20, 19:21

Another way to install uMatrix in Pale Moon 27 (under Linux) is to download the release source code for a specific desired version from the uMatrix github site (https://github.com/gorhill/uMatrix/releases), then extract the contents of the specific tar.gz file that was downloaded, then cd into the extracted folder and run the same build command as given by the OP.

For example, to build an XPI for uMatrix 1.1.18 one can do the following (assumes python is installed, follow step 2 from OP if unsure):
  1. Start in the home folder

    Code: Select all

    cd ~
  2. Download uMatrix 1.1.18

    Code: Select all

    wget https://github.com/gorhill/uMatrix/archive/1.1.18.tar.gz -O uMatrix-1.1.18.tar.gz
  3. Extract uMatrix 1.1.18

    Code: Select all

    tar -xzvf uMatrix-1.1.18.tar.gz
  4. Enter the new uMatrix directory

    Code: Select all

    cd ~/uMatrix-1.1.18
  5. Build the XPI bundle

    Code: Select all

    tools/make-firefox.sh all
    The new XPI module will be at the following path:

    Code: Select all

    ~/uMatrix-1.1.18/dist/build/uMatrix.firefox.xpi
  6. Now drag and drop the new XPI into Pale Moon to install (or install by navigating to the file as per step 4 from OP).
Unfortunately it seems that uMatrix 1.1.18 is the last version that works correctly on Pale Moon 27. There were evidently some significant code changes committed to uMatrix version 1.1.19rc0 (see https://github.com/gorhill/uMatrix/compare/1.1.18...3b77c07) with the result being that any version of the uMatrix extension higher than 1.1.18 no longer works in either PM 27 or Firefox ESR 52 (at least based on testing in PM 27.6.2 and FF ESR 52.5.2 by this user, including on both Windows and Linux systems).

What happens on both PM 27.6.2 and FF ESR 52.5.2 is that the pop-up uMatrix panel fails to render correctly on any uMatrix version higher than 1.1.18 (so this includes the latest main release 1.1.20 as well as all other tested release candidates listed on the releases page linked above). Here is how the uMatrix panel looks on any version higher than 1.1.18 for this user (on both PM and FF ESR):
Image
Perhaps someone with good JavaScript skills can figure out what changes have resulted in uMatrix 1.1.19rc0 and higher not working correctly on PM and FF ESR (the JS skills of this user are minimal and after looking at the various diffs it is not clear what code changes have resulted in the extension failing to work). If such a person has the inclination, a fork of uMatrix could be created that is designed to continue functioning correctly on PM and FF ESR. This forked version could then include whatever changes and bug-fixes are compatible with PM and FF ESR, of course without including whatever changes have broken the extension on these browsers since version 1.1.19rc0.

In the meantime, uMatrix version 1.1.18 works very well on both PM 27.6.2 and FF ESR 52.5.2 and the instructions above can be used to build and install this version. Note that once the XPI file is built it will of course install successfully on PM or FF ESR running under Windows as well.

Thanks to Raymond Hill for creating such an excellent extension, really a very sophisticated firewall for the web browser. And hopefully there will be a Pale Moon user out there with the necessary JavaScript skills who might step up to create a fork of the extension one day!

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ketmar » 2017-12-20, 19:44

the attached "hackfix" should make uMatrix great again. to apply it, download the patch file, copy it into uMatrix source code directory, and do "git am downloadedfile.patch" from there. if there will be no error messages, you can proceed as described, and UI should work again.
Attachments
0001-pm-messaging-API-hackfix.patch
(1.01 KiB) Downloaded 166 times

MoonSavvy
Hobby Astronomer
Hobby Astronomer
Posts: 16
Joined: 2014-11-21, 17:22
Location: California

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by MoonSavvy » 2017-12-20, 22:05

@ketmar

Thank you for the very fast response and the fix! The additional code you added in the patch file results in a good working uMatrix extension in PM for versions 1.1.19rc0 and higher. When I tried the command you mentioned ("git am 0001-pm-messaging-API-hackfix.patch") in the uMatrix git clone directory it failed due to an email address issue. Using the following command worked immediately without having to configure an email address:

Code: Select all

git apply 0001-pm-messaging-API-hackfix.patch
Alternatively, for those who want to build a specific patched version of uMatrix from a downloaded tar.gz file (similar to instructions above) the patch file can be placed in the appropriate uMatrix source code directory and then the "patch" command can be used to apply the changes to the source code. For instance, to build a patched uMatrix 1.1.20 (latest "official release" at this time) do the following:
  1. Start in the home directory

    Code: Select all

    cd ~
  2. Download uMatrix 1.1.20 source code

    Code: Select all

    wget https://github.com/gorhill/uMatrix/archive/1.1.20.tar.gz -O uMatrix-1.1.20.tar.gz
  3. Extract uMatrix 1.1.20 source code

    Code: Select all

    tar -xzvf uMatrix-1.1.20.tar.gz
  4. Enter the new uMatrix directory

    Code: Select all

    cd ~/uMatrix-1.1.20
  5. Download the patch file

    Code: Select all

    wget https://forum.palemoon.org/download/file.php?id=9713 -O 0001-pm-messaging-API-hackfix.patch
  6. Apply the patch file

    Code: Select all

    patch -p1 < 0001-pm-messaging-API-hackfix.patch
  7. Build the XPI bundle

    Code: Select all

    tools/make-firefox.sh all
    The new XPI module will be at the following path:

    Code: Select all

    ~/uMatrix-1.1.20/dist/build/uMatrix.firefox.xpi
Thanks again ketmar for providing this uMatrix fix for now! :thumbup:

User avatar
jars_
Lunatic
Lunatic
Posts: 397
Joined: 2016-12-27, 00:12

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by jars_ » 2017-12-20, 23:38

Thanks guys, on Win7 too all worked! :thumbup:

For those who want to repeat on Windows, I recommend a set of UnixUtils - where there is everything you need for this(link for download in the bottom page)

ScootyPuffJr

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ScootyPuffJr » 2018-01-04, 15:00

Hello chaps, new member here :wave:

I've been trying to patch the newest uMatrix build (1.1.21b6, as of today) but get this error message when getting to the patching stage:

Code: Select all

patching file platform/firefox/vapi-client.js
Hunk #1 FAILED at 148.
1 out of 1 hunk FAILED -- saving rejects to file platform/firefox/vapi-client.js.rej
I'm not sure if it is to do with new changes to uMatrix, etc as this is the first time I'm trying to patch with Unix Utils on Win 10 (never tried before) and was hoping someone could shed some light on what's wrong

Many thanks in advance, and for the effort that has already gone in to this thread :thumbup:

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ketmar » 2018-01-04, 16:24

it looks like 1.1.21b6 doesn't need that patch anymore. it still has some quirks that should be patched, tho, but it looks ok (working) without any patches.

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ketmar » 2018-01-04, 16:35

two hackfixes for new quirks in uMatrix 1.1.21b6.

the first one has something to do with webworkers blocking: i don't even know what it tries to accomplish, so i just forced it to keep silence instead of throwing an error. sorry.

the second one is something GH forgot to remove: there was an UA spoofer once, then GH removed it, but forgot to cleaned up some code. this fix is purely optional: uMatrix works without it, but spams js debug console with scary (yet completely harmless) error messages.


WARNING! please note that version newer than 1.1.21b6 may not need those patches anymore. don't be afraid to write here in case of any "strange" messages you may see when applying those patches, so i can investigate the cause and write an update!
Attachments
0001-webextflavor-hackfix.patch
(878 Bytes) Downloaded 41 times
0002-removed-remnants-of-content-spoofer.patch
(1.02 KiB) Downloaded 36 times
Last edited by ketmar on 2018-01-04, 16:41, edited 6 times in total.

ScootyPuffJr

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ScootyPuffJr » 2018-01-04, 18:54

Thanks for the quick update Ketmar, v1.2.0 has been released so tried to use the fixes on that and build but I think there's an issue with Unix Utils as I keep getting this error when building:

Code: Select all

tools/make-firefox.sh: line 33: python: command not found
And the install.rdf is screwed up, etc

If you get the time could you please upload a fixed (patched) .xpi of v1.2.0, or maybe recommend an alternative Windows Unix tool

Sorry for being a pain lol

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ketmar » 2018-01-04, 18:58

it is forbidden to upload xpis on the forum (or give direct links to xpis, for that matter ;-).

as for error message -- you need python3 installed. i don't know how to do it on win properly, sorry,

User avatar
JustOff
Banned user
Banned user
Posts: 2083
Joined: 2015-09-03, 19:47
Location: UA

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by JustOff » 2018-01-04, 19:38

ScootyPuffJr wrote:maybe recommend an alternative Windows Unix tool
You can use MozillaBuild environment, I tried 2.1.0 and it works just fine, other versions should be good as well.

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ketmar » 2018-01-05, 05:07

WARNING!

it seems that uMatrix versions after 1.1.21b1 aren't blocking inline scripts! it shouldn't be the effect of my hackfixes (i hope), but still: don't install any later version until somebody (either me, or some other person ;-) investigate the cause.

it still blocks access to sites, tho, so it's not completely useless. if you're using uMatrix with something like NoScript, you prolly have nothing to worry about.

WARNING!
Last edited by ketmar on 2018-01-05, 05:07, edited 1 time in total.

ScootyPuffJr

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ScootyPuffJr » 2018-01-05, 15:10

Thanks for the heads up about xpi rules (apologies mods for asking) and the warning about uMatrix inline blocking (or lack of!) in later builds Ketmar, much appreciated :)

I'll give MozillaBuild a try in a bit, cheers JustOff :thumbup:

ScootyPuffJr

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ScootyPuffJr » 2018-01-05, 21:01

Just a quick update; v1.1.21b1 running fine after building in MozillaBuild :thumbup:

As a side note, is this your uMatrix fork on Github Ketmar?

https://github.com/calibrations/uMatrix

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: How to install uMatrix in Pale Moon 27 in GNU/Linux (Ubuntu)

Unread post by ketmar » 2018-01-05, 21:05

nope, i don't have GH account at all.

Locked