Subject: [bug#76616] [PATCH 0/2] gnu: librewolf: Allow installation of unsigned extensions.

From: Clément Lassieur <[email-masked]>
Date: Fri, 28 Feb 2025 12:49:07 +0100

Hi,

On Fri, Feb 28 2025, Mike Jones wrote:

> Thanks, I didn't know about that! It seems to only allow ones in
> $ICECAT_SYSTEM_DIR - if you build your own outside of a Guix package, it
> won't let you install it, saying "This addon could not be installed
> because it has not been verified". Even overriding ICECAT_SYSTEM_DIR to
> point to a directory containing my locally-built extension doesn't
> work, so I guess there is some other condition.

Librewolf (and other Firefox based browsers in Guix) don't look at
$ICECAT_SYSTEM_DIR for extensions, but at
$ICECAT_SYSTEM_DIR/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}.

{ec8030f7-c20a-464f-9b0e-13a3a9e97384} is the application ID of
Firefox[1].

Also in that directory, your extension must be a directory or an .xpi
file whose name must be the add-on id[2] (e.g. ‘[email-masked]’
for a directory, or ‘[email-masked]’ for an xpi file).

Finally, Firefox checks for add-ons updates by comparing their path with
a cached one.  So make sure to change the path, or use another database
(move ~/.mozilla/icecat or ~/.librewolf...). before starting the browser
with an updated add-on.

So for example if I run ‘guix shell ublock-origin-icecat librewolf’, and
then
‘ls $ICECAT_SYSTEM_DIR/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}’,
I'll see ‘[email-masked]’.

You can definitely do
‘mkdir -p ~/test/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}’,
copy your .xpi (or extension directory) in there, and run librewolf like
this:

‘ICECAT_SYSTEM_DIR=/home/clement/test librewolf’

With Librewolf, system add-ons are disabled by default (you need to
enable them manually), I don't know why.  But on other browsers (icecat,
torbrorwser, mullvadbrowser), it works correctly.

[1]: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/icecat-extension.scm.
[2]: https://github.com/mozilla/gecko-dev/blob/27911e76eda11399d264abdae98039bda248533d/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs#L1086

Cheers,
Clément

> I think it's still useful to have this option, in case someone wants to
> build and install an extension that's not packaged in Guix yet. What do
> you think? I can try Ian's suggestion of using the upstream mozconfig as
> a base which would give us this as a side-effect.