Firefox Snap: Local extension/addon registration

Hello, I am new to snap and I have a question about Firefox and local XPI extension registration.

We use /etc/firefox/policies.json (policies / Extensions / Install - see policy-templates | Policy Templates for Firefox) to register an XPI file which is installed locally by using a file://-URL. The XPI file linked to is currently located in an /opt directory where our application is installed. This worked perfectly fine in Firefox Snap 116.0.1.

However, in the latest Firefox version (134.0.1) the extensions are no more recognized by Firefox. I found out that when I put the XPI file to the /etc/firefox/policies directory (obviously Firefox has access to this directory as it shows the configured policy in about:policies) instead of the /opt directory it works again, however, it does not work in other sub-directories in /etc.

My question: What’s a correct place to install local XPI files where Firefox Snap can access them? How can I find out to which directories Firefox Snap has local access to?

Thank you and regards, Dominik

For system wide files you can use firefox’s $SNAP_COMMON directory (which translates to /var/snap/firefox/common/) if you have things particulary bound to the firefoix version you could use $SNAP_DATA which translates to /var/snap/firefox/current though note that the latter dir gets copied forward with each new snap revision (and switches back along the snap if you do a snap revert)

1 Like