A quick outline of Firefox extension structure

November 23, 2005

Yesterday I mentioned Firefox extensions in passing. Let's fill in the blanks.

Firefox extensions come as .xpi files, which are just yet another extension for ZIP archives. Unpacked, extensions live in their own directory in the extensions/ subdirectory in your Firefox profile directory. Firefox profile directories live under ~/.mozilla/firefox; the default profile is in <something>.default. (Firefox randomizes the name of the profile directory, I believe due to security concerns.)

The actual name of an extension's directory is mostly opaque; it is '{<ID>}', where <ID> bit is the UUID (nee GUID) for the extension. The easiest way to find out which is which is to skim the install.rdf file from each directory, looking for the em:description or em:name attributes.

(Alternately, you can look at 'ls -lt' and remember the order in which you installed extensions.)

Most extensions stick their .jar files in their own chrome/ subdirectory. Using .jar files is not mandatory, and some extensions ship with their files fully exploded. (This is simpler on the developer but takes more space.)

The em:maxVersion field in appropriate bits of install.rdf control what the highest version of Firefox the extension can be installed on. However, if this matters to you you probably want to install the Nightly Tester Tools which let you just override it when necessary.

(For more information on the code structure of extensions and how they work, see the knowledge base.)

Written on 23 November 2005.
« How to fiddle with Firefox .jar files relatively easily
Multiprocessors are a leaky abstraction »

Page tools: View Source.
Search:
Login: Password:

Last modified: Wed Nov 23 00:32:51 2005
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.