Wandering Thoughts archives

2005-11-23

A quick outline of Firefox extension structure

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.)

programming/FirefoxExtensionsQuickIntro written at 00:32:51; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.