For the past few days, I’ve been working on writing a Firefox Extension. There are thousands and thousands of add-ons for Firefox, including a number of them which are geared toward improving library experiences or helping you find something at your library. There are also opportunities for plug-ins with new functionality, so here’s a guide to some of the resources that I’ve used so far in building my extension.
Extend Firefox – This is a great step-by-step tutorial on how to build an extension. It covers the initial set of files needed, how to create UI, and even extension distribution. The main downside I found was that it was so focused on the particular task of the example extension that it didn’t provide general instruction in some areas. However, it was helpful to see the process that someone else went through to create an extension.
Extensions – This is a set of pages from Mozilla that describe the process of building an extension. In particular, the tips about setting up an extension development environment and programmatic methods of installing extensions have been very useful. I’m sure that once I’m done, the pages on extension packaging will be helpful, but I’m not there yet. Make sure to set up a separate development profile so that you can run multiple instances of Firefox: one to test your extension, and one to follow steps in the various tutorials or to access a search engine for tips when you run into problems.
Firefox Extensions – This is another set of pages from Mozilla, but it focuses specifically on Firefox. It provides links to a step-by-step guide, and also to Firefox code snippets that might come in handy if you’re not quite sure how to do something.
How To Develop a Firefox Extension – This is another great site that provides a very detailed example of how to develop an extension. The example that it provides is code which puts a red box around each link on a page which has the “target” attribute. Depending on the type of extension you’re building, this may be more useful than the Extend Firefox site. It ended up being more useful for me, because I wanted to develop something that had options available from the add-ons panel (which is what this example shows) rather than from Firefox’s Options panel (which is what the Extend Firefox site shows). This also shows you how to autorun your extension code on file load; how to allow the user to toggle a preference to autorun; how to search for something in the loaded HTML; and how to add items on top of that HTML.
Firefox Extension Wizard – Unfortunately, I found this after I had already built a working, proof-of-concept extension! I guess there’s something to be said for doing it by hand, but this neat tool will build an extension for you that will allow you to just jump right into developing your code without having to create the initial framework. Of course, it’s good to have some of the background knowledge before using this. For example, according to the Mozilla documentation, it’s recommended that you use an email address, rather than a typical guid, for your extension ID.
These resources were great in helping me to get started writing a Firefox extension. If you have an idea and want to try writing an extension, I hope they’ll help you as well.
My name is Heather and I ♥ monkeys. I am a computer scientist in San Jose and my background is in cognitive science, computer science, usability, and library and information science. My interests include preservation, oral history, indigenous knowledge and technology. 
It‘s quiet in here! Why not leave a response?