mozilla

Revision 53707 of Extension Packaging

  • Revision slug: Extension_Packaging
  • Revision title: Extension Packaging
  • Revision id: 53707
  • Created:
  • Creator: Dria
  • Is current revision? No
  • Comment

Revision Content

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

{{wiki.template(':en/Toolkit_API/Official_References')}}

Revision Source

<p>Extensions are a form of <a href="en/Bundles">Installable Bundle</a> which can be downloaded and installed by a user, or provided pre-packaged with an application or by an external program. Extensions use a <a href="en/Bundles">directory structure</a> which can provide chrome, components, and other files to extend the functionality of a XUL program.
</p><p>Every extension must provide an <a href="en/Install.rdf">install.rdf</a> file which contains metadata about the extension, such as its unique ID, version, author, and compatibility information.
</p><p>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.
</p>
<h3 name="Making_an_Extension_XPI"> Making an Extension XPI </h3>
<p>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.
</p><p>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:
</p>
<pre class="eval">AddType application/x-xpinstall .xpi
</pre>
<h3 name="Install_Extension_Files_Directly"> Install Extension Files Directly </h3>
<p>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 &lt;appdir&gt;/extensions/&lt;extensionID&gt;. The extension will be found automatically by the extension manager the next time the application is launched.
</p>
<h3 name="Register_an_Extension_Location_Using_the_Windows_Registry"> Register an Extension Location Using the Windows Registry </h3>
<p>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 <a class="external" href="http://wiki.mozilla.org/Extension_Manager:Win32_Registry_Location">using the registry</a>.
</p>
<h3 name="Multi-Item_Extension_XPIs"> Multi-Item Extension XPIs </h3>
<p>In some cases a single XPI file may wish to install multiple extensions/themes. A special kind of extension XPI called the <a href="en/Multiple_Item_Packaging">Multiple Item Package</a> explains how to create this kind of package. (Firefox 1.1/XULRunner 1.8 required.)
</p>
<h3 name="Official_References_for_Toolkit_API"> Official References for <a href="en/Toolkit_API">Toolkit API</a> </h3>
<p>{{wiki.template(':en/Toolkit_API/Official_References')}}
</p>
Revert to this revision