Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 836
Daniel J F Avatar asked Jan 17 '23 07:01

Daniel J F


1 Answers

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.

like image 65
Wladimir Palant Avatar answered Jan 29 '23 01:01

Wladimir Palant