Wordpress Themes

A place for my programming projects and the occasional blog about technology related matters.

Extension development tip

Author einar

If you’re developing Mozilla Extensions it can be quite annoying to keep packaging your extension after every change, installing it and restarting Firefox/Thunderbird to test your changes. Fortunately there’s an easier way.

First of all, I don’t use the jar-inside-xpi style, I just have my chrome in a normal folder inside the xpi and set it up like this in chrome.manifest:

content myextension file:chrome/content/

This way you can just install it once, and then just work on it inside your Mozilla Profile/extensions folder. The folder structure in the installed extension is exactly like it was in my development folder. But still, I don’t like working directly in the extensions folder. I have all my extensions in SVN and in a /programming/mozilla folder on my drive and I just want to edit them there, instead of editing them in the extensions folder and keep copying them over to the programming folder to commit to SVN. And this can be done, I just saw this described a few weeks ago on some Mozilla page. What you do is this:

  1. Leave your extension in your development folder, e.g. c:\programming\mozilla\myextension
  2. In your Mozilla profile/extensions folder, create a text file with the same name as the guid of your extension, for instance myextension@einaregilsson.com. In the text file put just one line, the path to your extension: c:\programming\mozilla\myextension

And that’s it. Now when you restart Firefox it will act like your extension is installed but you can keep working on it right in your programming folder, no packaging or re-installing necessary. As far as I know this only works with Firefox, not Thunderbird, at least not the 1.5 branch.

CommentComment

For spam detection purposes, please copy the number 5448 to the field below: