Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open Firefox with a temporary add-on on startup

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?

like image 681
please delete me Avatar asked Jan 26 '17 05:01

please delete me


1 Answers

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.

Installing 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

References

  • Getting started with web-ext
  • web-ext command reference
like image 69
Makyen Avatar answered Oct 27 '22 05:10

Makyen