Reputation: 1064
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
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:
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.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
Reputation: 2955
I know this question already has an accepted answer, but: You don't necessarily have to do that.
{8956a28d-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
)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