Skip to content

Disable extension signing requirement in Firefox 49 or later

mikhoul edited this page Oct 20, 2017 · 7 revisions

Note: This workaround is being discussed on issue 183. As more definitive information is found, it may be added here.

I just built Firefox 49 on Ubuntu 14.04 Trusty, switching from Gtk3 back to Gtk2 (because there's no Gtk3 version of my Gtk2 theme, QtCurve). Firefox 48 allowed me to install the Pentadactyl XPI I packaged, but Firefox 49 did not. sigh

A bit of googling around led me to this: http://www.ghacks.net/2016/08/14/override-firefox-add-on-signing-requirement/ I followed the instructions, restarted Firefox, and it worked, enabling me to install unsigned XPI extensions without rebuilding Firefox.

I think this should be documented somewhere prominently, as it saves a lot of trouble compared to rebuilding Firefox (until Mozilla kills this avenue, of course...). For posterity, here is a simple version of the instructions for Linux:

  • Create file /usr/lib/firefox/config.js with the following content:
//
try {
Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm", {})
.eval("SIGNED_TYPES.clear()");
}
catch(ex) {}

try {
Components.utils.import("resource://gre/modules/addons/XPIInstall.jsm", {})
.eval("SIGNED_TYPES.clear()");
}
catch(ex) {}
  • Create file /usr/lib/firefox/defaults/pref/config-prefs.js with the following content:
pref("general.config.obscure_value", 0);
pref("general.config.filename", "config.js");
  • Restart Firefox.

Now you should be able to install unsigned extensions.

On Windows the file locations look like:

C:\Program Files\Mozilla Firefox\config.js
C:\Program Files\Mozilla Firefox\defaults\pref\config-prefs.js

or

C:\Program Files (x86)\Mozilla Firefox\config.js
C:\Program Files (x86)\Mozilla Firefox\defaults\pref\config-prefs.js

If (when?) Mozilla "plugs" this "hole", it should be possible to rebuild Firefox to disable extension signing by doing this:

  • Download and extract the Firefox source (e.g. on Debian/Ubuntu, apt-get source firefox)..
  • Open the file toolkit/mozapps/extensions/internal/XPIProvider.jsm.
  • Find this code:
const SIGNED_TYPES = new Set([
      "webextension",
      "extension",
      "experiment",
  ]);
  • Remove extension and webextension from the set.
  • Build and install Firefox (out of scope for these instructions).

Notes

This has been verified to work on Firefox 54

Clone this wiki locally