Extensions are a form of Installable Bundle which can be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. Extensions use a directory structure which can provide chrome, components, and other files to extend the functionality of a XUL program.
Every extension must provide an install.rdf file which contains metadata about the extension, such as its unique ID, version, author, and compatibility information.
After the extension files and install.rdf have been prepared, there are several ways to prepare an extension for installation: ZIP the extension directory into a user-installable XPI (xpinstall) file, unpack the extension directly into the user's application or profile directory, or register the extension in the Windows registry.
Making an Extension XPI
An XPI (xpinstall) file is simply a ZIP file containing the extension files, with the "install.rdf" file at the root of the ZIP. Users can download and install XPI files off the internet, or from a local file by dragging the XPI file onto the extension manager UI.
The mime type recognized by Firefox for XPI files is "application/x-xpinstall". Since most web servers are not configured with the .xpi mimetype mapping by default, you may need to add the following directive to an Apache .htaccess file or to httpd.conf:
AddType application/x-xpinstall .xpi
Install Extension Files Directly
If you know the location of the application (if you are installing an extension as part of the application installer, for example), you can install the extension files directly to <appdir>/extensions/<extensionID>. The extension will be found automatically by the extension manager the next time the application is launched.
Register an Extension Location Using the Windows Registry
External installers (such as the Java runtime) may wish to install application integration points as extension even if the application is not yet installed. This can be accomplished on Windows using the registry.
Multi-Item Extension XPIs
In some cases a single XPI file may wish to install multiple extensions/themes. A special kind of extension XPI called the Multiple Item Package explains how to create this kind of package. (Firefox 1.1/XULRunner 1.8 required.)
Official References for Toolkit API