Automatic installation of the Firefox extension

I am creating a Firefox extension and I have a folder with extension files. Every time I want to test, I need to zip it, change the extension to .xpi, drag and drop it into the Firefox window, wait 3 seconds, click the Install button, and restart the browser.

I made a batch file that zips the folder and changes the extension, but is it possible to completely reinstall it using a script, without the drag and drop procedure?

+3


source to share


2 answers


Edit (2017-06-25) . Starting in Firefox 57, classic extensions (including the add-on auto-installer mentioned below) will stop working. This means that now your choice is:

  • Go to about:debugging

    and download the extension as a temporary add-on. This will allow you to reload it with one click when you make changes - either to the package or to the unpacked directory, both are possible.
  • Use the web-ext command line tool , it can install your extension as a temporary addon from the command line. It can also view extension files for changes and reload automatically.

The original answer for reference will only work up to Firefox 56.



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

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

      

This will automatically install your extension in the browser and restart it if necessary. If you need to sign extensions, it will offer to install the extension as a temporary add-on for the current browser session.

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

+4


source


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

  • Open the help menu.
  • Select troubleshooting information
  • Find your profile folder and click the Show Folder button next to it. This will open your Firefox profile folder.
  • In the extension folder, create a new folder with the ID or name of the extension. (Example {8956a28d-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

    )
  • Just edit your extension files and restart your browser. The changes will take effect as soon as possible!


Note . The first time you start Firefox after this implicit installation, you will be prompted to allow this installation; just allow it.

PS It's a good idea to have an Extension Developer extension; this will make things easier (like restarting Firefox with one click).

+4


source







All Articles