Is there a way in which I can open Firefox and force it to load a temporary add-on (webextension) on startup? Normally I have to manually go to about:debugging
and select the extension on my hard drive. I'm looking for a flag I can pass when I load Firefox so that this is done automatically.
If this is not possible, is there a recommended extension I can install to simulate that a user opens this URL and adds this extension?
Yes, you can use the command web-ext run
from the directory in which the extension exists. This will start Firefox with the WebExtension installed using a temporary profile. web-ext run
is intended for testing your WebExtension add-on during development, not for normal use of Firefox. By default, the web-ext run
command will watch your WebExtension's files and automatically reload the extension when any of the files are changed. You can disable this feature by using the --no-reload
option.
If you are using a Firefox version below 49, you will need to specify the --pre-install
option which uses a different method of installing the extension in the profile. However, if you use the --pre-install
, your WebExtension will not be operational if you are trying to use a release or beta version of Firefox and the extension is not signed. This basically means that using --pre-install
is not useful for Firefox versions below 49 unless you are using a Developer Edition build. Using --pre-install
can be useful for Developer Edition versions of Firefox above 49 if you are wanting to test how your extension behaves during Firefox startup. If you do not use the --pre-install
option, your extension is installed as a temporary extension and does not need to be signed to be tested in release versions of Firefox.
If you want to use a specific profile, then you need to specify the profile using the --firefox-profile
option. MDN says:
When using a custom profile, web-ext first copies the profile. The custom profile will not be altered.
web-ext
You will need to install web-ext
. You can do so by following the instructions in Getting started with web-ext. The instructions are to, after you install node/npm, run the following command:
npm install --global web-ext
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With