1

So, edit the code, zip to xpi, install the add-on, test, repeat.

Nice for testing a few examples, but it becomes quickly tedious. There must be a smarter way, there surely is a smarter way, but I'm not smart enough to find it myself. Help ? How do you do it ? The goal is to smoothen the learning curve by quickly testing features and ideas.

I've thought of the following, but don't really know if it could work, nor where to start :

  • Have the addon scripts link to external js files, so you can install the addon once and for all, then quickly edit the external files at will
  • utilize the update mechanism, but I'm not sure it pertains to WebExtensions
  • make an ad-hoc webExtension to update the one I'm developping
  • ...?
Éric Viala
  • 596
  • 2
  • 12
  • There are tools like - https://addons.mozilla.org/en-US/firefox/addon/xpicompiler/ – Noitidart Mar 10 '16 at 08:10
  • 1
    Thanks a lot ! This looks like exactly what I was looking for. I'll try it the noitidartional way as soon as I can. ATM though I've shifted my focus on Google Chrome but I'll necessarily be back to The Fox soon. – Éric Viala Mar 21 '16 at 12:57
  • Hahaha nice catch on my name :P Not too many people realize that :P – Noitidart Mar 22 '16 at 02:45
  • Also another why which you might like is the `jpm run` method. SDK will have future support. So you might want to make a jpm addon till the WebExt tools are ready. – Noitidart Mar 22 '16 at 02:46

2 Answers2

2

Well, as of today this is working for me: (For web-extensions, the old standard must be used with jpm, as pointed by Noitidart in the comments of the question)

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext

Install with

npm install -g web-ext

Run in the root directory of your extension with the command

web-ext run

You also need firefox 49+ to work properly. You can use the --firefox-binary option to point to the path of a custom installed firefox. It detects any changes in the development folder and reloads the extension.

Marcelo
  • 123
  • 6
1

Testing WebExtensions

To test WebExtension based add-ons, they can be loaded as a "Temporary Installation in Firefox"

That MDN page describes how to temporarily install a WebExtensions (i.e. similar code to Chrome) in Firefox. The gist of it is:

  1. Navigate to about:debugging
  2. Click the button "Load Temporary Add-on"
  3. Use the file selection dialog to select the manifest.json file, or packaged .xpi file for the extension.

Load a temporary add-on

Note on testing WebExtensions:
The WebExtensions API is still in development. For now, you are probably best off developing and testing your WebExtension add-on with Firefox Developer Edition, or Firefox Nightly. You should also make careful note of what version of Firefox is required for the functionality you desire to use. This information is contained in the "Browser compatibility" section of the MDN documentation pages.

The contents of this answer were copied from my answer to How to test firefox plugin locally

Community
  • 1
  • 1
Makyen
  • 31,849
  • 12
  • 86
  • 121