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.
calibrations

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

Unread post by calibrations » 2018-01-05, 23:42

That's my github! Sorry I'm so late to the party, I was having trouble getting a confirmation email through to register on here.

There were a number of problems with newer versions built from source that I have tried to patch myself, but I must first admit that I am a complete and utter noob with no experience other than playing around in python for personal use. In particular things like the referer spoofer and as you've noticed blocking inline scripts were broken, I think I have fixed those but cannot be sure I haven't made any mistakes. I hope someone can look at my code (in legacy firefox branch) and look for anything obvious or bad style or the like.

Anyways, I was going to ask if there is anyone with more experience who might be able to assist with a proper fork so people who are unable to build from source can still use it . I have attached my patches that I have so far to be applied to version 1.2.0, with the only bug I know of being that blocking web workers doesn't work in Pale Moon (it works fine in Firefox 52, but I think it can't be made to work until support for child-src in Content Security Policy is added for those interested). Test at your own risk!
Attachments
for-1.2.0.patch
(5.72 KiB) Downloaded 247 times

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35402
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

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

Unread post by Moonchild » 2018-01-06, 00:08

For the record, "child-src" was already obsolete when it landed in the spec. It should not be used.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

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-06, 00:35

2calibrations: it looks like your patch is working (and mine was completely wrong, lol). i didn't do a proper check, tho (only checked that sites are really blocked, and inline scripts aren't fired anymore). anyway, i switched to your patched version, so i think we'll see if something will go wrong. ;-)

tnx for your work!
Last edited by ketmar on 2018-01-06, 00:35, edited 1 time in total.

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-06, 00:41

2Moonchild: will Pale Moon have "worker-src" implemented then? or it is already there, and i missed it?

calibrations

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

Unread post by calibrations » 2018-01-06, 14:31

Thanks for the heads up Moonchild, I'll keep that in mind :) I had seen that it was deprecated in Pale Moon issue 949 when I was looking for more information on it, I was trying to point out to people not to expect it to work but perhaps I should have been clearer. I'd left it in for now incase anyone wanted to to try it out with Firefox ESR where it does still work (even the Webextension version of uMatrix uses it, Chrome is still the only browser with worker-src it seems).

Ketmar I don't think you were far wrong, you were looking in the right places at least. Thanks for your patches so far, I wouldn't have been inspired to look without your first patch :D

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_ » 2018-02-21, 11:05

Not working tab "hosts files", not shown default files with block-rules. Trying version 1.21b2
with patch 0001-pm-messaging-API-hackfix.patch ketmar
error 1.21b2
Image
working version v 1.16
Image
Is there a solution for this case?

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_ » 2018-03-04, 12:47

version uMatrix 1.3.2 works fine, without any patches ;)
Last edited by jars_ on 2018-03-04, 12:51, edited 1 time in total.

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-03-04, 12:59

no, it doesn't.

User avatar
Moonraker
Board Warrior
Board Warrior
Posts: 1878
Joined: 2015-09-30, 23:02
Location: uk.

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

Unread post by Moonraker » 2018-03-04, 13:57

ketmar wrote:no, it doesn't.
Are you going to be punch or judy...?..lol. :D
user of multiple puppy linuxes..upup,fossapup.scpup,xenialpup..... :thumbup:

Pale moon 29.4.1

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_ » 2018-03-04, 14:11

no, it doesn't.
:?: it`s not perfect, had an error in Console, yes...

Code: Select all

Метка времени: 04.03.2018 15:43:18
Ошибка: uncaught exception: Error opening input stream (invalid filename?): chrome://umatrix/content/js/contentscript-end.js
and this is not very good, but works; blocking scripts and xhr, all options shown correctly - which is exactly what I need.
To fix this error would be good, of course. But I have not yet noticed any consequences. :think:

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_ » 2018-03-04, 14:34

there is still no such file(contentscript-end.js), so just comment out the line 306 in frameModule.js to get rid of the error.
frameModule.js :
line 306: // lss(this.contentBaseURI + 'contentscript-end.js', sandbox);

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-03-04, 14:40

it doesn't block all scripts without proper fix. you just happened to not notice those rare circumstances where it doesn't. please, don't tell that "it works" until you fully understand how exactly uMatrix works internally, and why some internal errors matters or not.

User avatar
nicolaasjan
Moon lover
Moon lover
Posts: 85
Joined: 2017-07-28, 14:44
Location: The Netherlands

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

Unread post by nicolaasjan » 2018-03-23, 15:48

I was able to build uMatrix up until version 1.3.2 (albeit with the contentscript-end.js error in the console), but with 1.3.4 I get this where the icon should be:
Image
When I hover over it, a small rectangle shows and when I click on it the uMatrix interface opens.
Is there a way to fix this bug and the script error as well?

For now I have disabled uMatrix and enabled NoScript again...
Linux Mint 20.3 Mate 64bit
Pale Moon latest

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-03-23, 16:36

but what is wrong with using the old version, which works perfectly?

User avatar
Baloo
Fanatic
Fanatic
Posts: 167
Joined: 2017-08-24, 15:02

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

Unread post by Baloo » 2018-07-18, 04:29

I'm still using the last Firefox XUL version of uMatrix in Pale Moon, 1.1.4. Are there any plans to continue the possibility of forking it for Pale Moon users? Right now it's been working just fine though.
Image
Image

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-07-18, 13:29

tbh, i don't see any reason to fork it. as you said, the old version is working ok, and i honestly cannot see anything i need to fix/add so badly that i have to fork uM. as Pale Moon is not going to break extensions with each new release (i am currently on PM 28 beta, and everything still works ;-), i don't think that there is a real need to fork uM. if uM will ever stop working, we'll return to this question, but until then, it is fine as it is now, i believe. for now, i am using uM, and if it will break, i'll prolly try to fix it.

of course, there can be other brave souls, and somebody may create a fork. that will be great, 'cause it will free me from one constant headache (watching for uM to not break ;-).

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 » 2019-01-14, 23:56

tl;dr --> uMatrix 1.3.2 works perfectly in all latest PM versions and is much improved over v1.1.4 (last official XUL version) <--

An update about uMatrix functionality in Pale Moon (for those who use uMatrix and/or are interested) is that uMatrix 1.3.2 released in Jan 2018 has been working perfectly for me in PM over the past year including with all PM versions through 28.2.2 (most recent PM release at the time of this post).

A number of bugfixes/improvements for uMatrix are included in v1.3.2 that are not in v1.1.4, with a big change being the addition of a global scope button (the star) in the pop-out panel. The star button was added in version 1.1.8 and makes it much easier to do global scope changes than in earlier versions.

To make uMatrix 1.3.2 for PM one can follow the below steps (an updated version of steps from this earlier post, with newer file names as appropriate). These steps are intended to be run on a Linux system though should work fine in Cygwin or a similar Linux subsystem running on Windows (python must also be installed and working correctly, steps to check this on Debian/Ubuntu based distributions are in the OP for this topic):
  1. Start in the home directory

    Code: Select all

    cd ~
  2. Download uMatrix 1.3.2 source code

    Code: Select all

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

    Code: Select all

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

    Code: Select all

    cd ~/uMatrix-1.3.2
  5. Download the patch file (from this post)

    Code: Select all

    wget https://forum.palemoon.org/download/file.php?id=9837 -O for-1.2.0.patch
  6. Apply the patch file

    Code: Select all

    patch -p1 < for-1.2.0.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.3.2/dist/build/uMatrix.firefox.xpi
This XPI file can simply be dragged into Pale Moon to install it, the same as for any other extension. Note that although the linked patch was created for v1.2.0 it works perfectly for creating a functional XUL extension up through uMatrix v1.3.2, including relative to blocking of inline scripts. The informative BrowserLeaks test page here is a quick way to confirm whether uMatrix is working correctly relative to inline, same-origin and also third-party scripts.

For uMatrix 1.3.4 and higher the pop-out panel fails to render properly in PM (either 27.x or 28.x) even after applying the linked "for 1.2.0" patch, thus making uMatrix impossible to use. Creating a fork of uMatrix and doing some serious code debugging might reveal why the pop-out panel fails to render for v1.3.4+ though with v1.3.2 working perfectly it is not really a priority.

Perhaps at least a fork on GitHub for uMatrix 1.3.2 with a pre-created XPI download that has the patch already integrated would be handy for Pale Moon users. So if I get around to that I will post back to this topic to let folk know (and maybe with a working PM-specific fork of uMatrix 1.3.2 the good folks who create Pale Moon would even be happy to host it on the main PM extensions site)! 8-)
Off-topic:
A final slightly off-topic (though useful for some) note is that the uMatrix 1.3.2 extension created by the above steps also installs and works fine with Firefox ESR 52.x, being the last useful Firefox version for many people due the bizarre (?!) choice the Mozilla Foundation made (shooting in foot) to entirely remove XUL extension support after FF v52 and switch to Web Extensions, thus turning Firefox into "Fire-Chrome" (and obliging however many thousands/millions of long-term FF users who depend on XUL extensions for their work to ditch FF for greener pastures, such as provided by Pale Moon!).

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 » 2019-01-15, 00:05

Thank you for the update, MoonSavvy - quite promising stuff. :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_ » 2019-02-07, 17:51

For uMatrix 1.3.4 and higher the pop-out panel fails to render properly in PM
hehe... i make a CSS-style in userChrome.css for button bug:

Code: Select all

#umatrix-legacy-button[badge]::before { content: "uM" !important; font: bold 1em Arial !important; }
it looks like this Image
in last XUL-compatible version uMatrix 1.3.12 (internal number 1.3.3b8) :)

User avatar
nicolaasjan
Moon lover
Moon lover
Posts: 85
Joined: 2017-07-28, 14:44
Location: The Netherlands

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

Unread post by nicolaasjan » 2019-02-15, 16:21

r4and0mUs3r wrote:For anyone interested .. decided to have a go at building this according to MoonSavvy's post ..

... building uMatrix v1.3.2 : v1.3.4 : v1.3.6 with the patch, they each appear to work correctly according to checking them at the BrowserLeaks page .. with the exception of the Icon/button not being available/visible in the latter two.

Found this .. the "Update Badge" section in the v1.3.2 "tabs.js" file is the only significant difference in that file between the three versions. Copying just that section of code from v1.3.2 to 1.3.4 or 1.3.6 results in the Icon/button being usable again.

This appears to work because it seems the rest of the icon breaking changes were not incorporated until v1.3.8 .. and from that version up, trying the same thing no longer works.
It's only a partial solution, if that, but maybe it's helpful ..

cheers.
That sure is helpful.
Thanks!

I even tried building version 1.3.8 as per your instructions and it works here (Linux Mint 17.3)...
The icon behaves as it should.
I have not (yet) tried any higher versions.

One thing though: the refresh button in the logger does not work :? .
Have to refresh the webpage itself to actually fill the logger...
Linux Mint 20.3 Mate 64bit
Pale Moon latest

Locked