views:

2013

answers:

4

Debugging a Firefox addon is a slow process: (1) edit source code in a JS editor (2) package into XPI using a build script (3) drag into Firefox to install (4) restart Firefox (5) open the JavaScript Debugger

Can we speeden up the process? Like install it into Firefox without a restart, or configure the build script to install it into Firefox as well?

+2  A: 

You need the "edit source" and "restart firefox" steps; they can't be removed from the process...

When you install the addon, the javascript ends up on disk, in your firefox profile. If you edit it in there, and restart firefox, the new stuff will be picked up. When you're done, create the xpi from the files in your profile.

Stobor
Great idea! Smarty.
Jenko
+14  A: 

You'll want to locate your profile folder. Once you find it, go into the folder called 'extensions', and then locate the folder for the add-on you are working on. Replace that folder with a file of the same name, and inside the file place the full path to your source directory of the add-on. As long as you don't use jar files inside your add-on, you will no longer have to rebuild (this is covered in a bit more depth here).

Additionally, you'll want to set nglayout.debug.disable_xul_cache to true. For edits to xul or js files, you'll just have to open up a new window to see your changes instead of restarting the application. There are other preferences here that you may find useful as well.

sdwilsh
+1 Good to know that restarting is not necessary...
Stobor
+2  A: 

i use Netbeans with the Foxbeans Plugin for addon development, there you just press the "run button", and firefox starts up with the addon installed (into a test profile). maybe you should give this a try!

bizzy
+1  A: 

http://simplygenius.com/2005/08/debugging-firefox-mozilla-extensions_25.html contains a good description of debugging FF extensions in venkman

AlexEzh