49

Previously, I could write an addon for personal usage packed as something.xpi and I clicked on it to install it.

After a while, mozilla introduced xpinstall.signatures.required which you could still get around it.

However, it did not stop stabbing developers who are interested to have a personal addon isolated from the world. Today, only web extensions are working and my XUL based addon is thrown away. The tutorials only talk about temporary installation of a web extension while I want my one runs on firefox forever.

Beside whether I can use web extension to write into files or create a GUI in an independent page, I have a bigger challenge:

How can I install a local web extension permanently without creating a Mozilla account for personal usage?

5

6 Answers 6

14

Navigate to the folder where your extension is located. You can build it in the usual way using web-ext:

web-ext build

You can install this ZIP file permanently in Firefox by going to about:addons and dragging this file into the tab.

In order for this to work, you need to set xpinstall.signatures.required to false in about:config (works only for Nightly and maybe Developer Edition).

2
  • 5
    In a new version you also need an ID in the manifest.json file, see another answer.
    – user202729
    Sep 26, 2021 at 1:50
  • 1
    "The generated .zip file doesn't work on Firefox without signing or adding browser_specific_settings.gecko.id key into manifest.json. For more information, please refer to the WebExtensions and the Add-on ID page." You need to add browser_specific_settings , see this page Nov 8, 2021 at 0:41
9

Apart from setting xpinstall.signatures.required to false, you need to add this to your manifest.json:

  "browser_specific_settings": {
    "gecko": {
      "id": "[email protected]"
    }
  }

Found on https://www.reddit.com/r/firefox/comments/blqffs/how_to_permanently_add_temporary_addon/exh2u3o/, thanks to "alexherbo2".

6

You need a "blueish" Firefox -- Developer Edition (effectively beta) or Nightly (unstable, updated every night).

You can get them from https://mozilla.org/firefox/channel/desktop/.

Then xpinstall.signatures.required will work again.

(As for permissions--you can create a GUI in a tab or a popup, but I don't think you can do it in a separate window (unless you do a webpage-style popup window). You won't be able to write to arbitrary files anywhere on the system--which is a good thing! You can write to the Downloads folder, and read/write some sort of internal storage, but that may not expose the actual files involved. For more information see https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Working_with_files.)

1
  • Maybe I shift to server-client using node.js as a quick working solution.
    – ar2015
    Feb 25, 2018 at 2:10
2

What you should be looking for is having your extension signed by Mozilla as Unlisted.

See Mixing Listed and Unlisted Add-ons on addons.mozilla.org blog post for an overview.

That way, AMO does not host nor (normally) review your extension; it simply runs some basic automated checks and immediately signs your extension so that it can be privately distributed as an XPI.

2

For those interested in developing/running an extension from a local directory without having to package or load it manually via "Load Temporary Addon..." from about:debuggin#/runtime/this-firefox please go to this github repository.

From the README.md:

The procedure involves a few steps, but it needs to be done only once.

First you need to enable AutoConfig aka userchrome.js by copying the file config-prefs.js to [Your Firefox install directory]/defaults/pref

Note: For best security, on Windows it is best to leave your Firefox install in "c:\Program Files" so that your config-prefs.js and userChrome.js can only be modified when you are in root/admin mode.

Then you need to edit the file userChrome.js and modify the function installUnpackedExtensions() to reflect the locations of your own addons.

The modified userChrome.js then must be copied to your Firefox installation directory. For example on Windows this is usually "c:\Program Files (x86)\Mozilla Firefox" for the 32-bit version of Firefox. You can rename the file, but remember to modify the corresponding line pref("general.config.filename", "userChrome.js") in defaults/pref/config-prefs.js

Now your addons from your local directories will be loaded automaticaly whenever Firefox starts. After editing your code remember to reload it from about:debuggin. You can also get there via the menu by selecting "More Tools", then "Remote Debugging", and click on "This Firefox" on the left side (but the quickiest way is to bookmark it and then add a bookmark keyword such as "dbg" for quick access.)

Please note that this is an automated install of the extension every time Firefox starts, so it is not quite the same as a "permenent install". That is, this procedure has exactly the same effect as clicking on "Load Temporary Addon..." from the about:debuggin page, just that the process is now automated via userChrome.js. This means that if you have code that does something after the installation of the extension such as browser.runtime.onInstalled.addListener(details => { if (details.reason == "install") { ...do something after install... }); then this code will be called every time Firefox is launched.

2
  • Thanks! This is working for me in the latest build (112.0.2) on macOS. I just put the files off of the <Application Dir>/Firefox.app/Contents/Resources/ directory.
    – Matthew S
    Apr 25 at 22:20
  • For my case(macOS, venture 13) worked when I put config-prefs.js into app-dir/Firefox/Contents/Resources/defaults/pref/ and userChrome.js into app-dir/Firefox/Contents/Resources
    – e.saleh
    Aug 2 at 6:38
-1

You can try setting the preference extensions.legacy.enabled (this will only work in Nightly or Dev Edition).

1
  • for me it is equal to true. But not all legacy addons can be enabled. My addon cannot be enabled too. Only, adblock can be enabled.
    – ar2015
    Nov 20, 2017 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.