Extensions are packaged and distributed in archive files (also known as Bundles), with the
XPI (pronounced “zippy”) file extension. At a minimum, they contain an install.rdf, the chrome.manifest and a chrome/ folder. The chrome/ folder contains a content/ folder that contains the actual content files. These files contain the code that makes your extension actually do something. When this tutorial is finished, our extension will look like this:
myfirstext.xpi: //created in step 8 /install.rdf //created in step 3 /chrome.manifest //created in step 4 /chrome/ /chrome/content/ /chrome/content/myhelloworld.xul //created in step 5 /chrome/content/overlay.js //created in step 6 /chrome/locale/* //Building an Extension# Localization /defaults/preferences/ //Building an Extension# Defaults Files
Rather than creating these files manually, you can use the Add-On Builder at Mozilla's Add-On Developer Hub. This creates an archive package that contains an extension framework, including the required files and directories. Unzip the archive into a directory called
'myfirstext' in your home directory and then edit the files to follow along with this tutorial.
The following tutorial pages will explain how to write each of these files (except locale/ and defaults/) and package them into an XPI (zippy) file. You can find information about the locale/ and defaults/ folders in the more general "Building an Extension" documentation.