Daniel J F
Daniel J F

Reputation: 1064

Firefox extension auto installation

I'm creating a Firefox extension and I have a folder with files of the extension. Every time I want to test in I have to zip it, change the extension to .xpi, drag&drop it to Firefox window, wait for 3 seconds, click install button and restart the browser.

I've made a batch file that zips the folder and changes the extension, but is it possible to reinstall it completely with the script, without drag&drop routine?

Upvotes: 5

Views: 4795

Answers (2)

Wladimir Palant
Wladimir Palant

Reputation: 57691

Edit (2017-06-25): As of Firefox 57, classic extensions (including Extension Auto-Installer mentioned below) will stop working. This means that your choices are now:

  • Go to about:debugging and load your extension as a temporary add-on. This will allow reloading it with a single click, whenever you make changes - either to a package or to an unpacked directory, both are possible.
  • Use the web-ext command line tool, it can install your extension as a temporary add-on from the command line. It can also watch extension files for changes and reload automatically.

Original answer for reference, will only work up to Firefox 56.

Actually, that's why I created Extension Auto-Installer a while ago. Install the extension in your test browser and add the following to your batch script:

wget --post-file=extension.xpi http://localhost:8888/

This will automatically install your extension in the browser and restart it if necessarily. If signing extensions is required, it will offer to install the extension as a temporary add-on, for the current browser session only.

As you seem to be using Windows, you will need Wget for Windows or a similar command line tool.

Upvotes: 6

Javid
Javid

Reputation: 2955

I know this question already has an accepted answer, but: You don't necessarily have to do that.

  1. Open up Help menu.
  2. Select Troubleshooting Information
  3. Find Profile Folder and click on Show Folder button next to it. This will open your Firefox profile folder.
  4. In the extensions folder, create a new folder with your extension ID or name. (Like this: {8956a28d-xxxx-xxxx-xxxx-xxxxxxxxxxxx})
  5. Just edit your extension files, and restart the browser. Changes will take effect in no time!

Note: First time you run Firefox after this implicit installation, you'll be asked to allow this installation; just allow it.

P.S. It's a good idea to have the Extension Developer add-on; it'll make things easy (For instance, restarting Firefox with one click).

Upvotes: 4

Related Questions