Warning: The content of this article may be out of date. It was originally written in 2005. A newer document is available: Creating a Firefox sidebar
This article describes how to create a registered sidebar for Firefox 2 or greater. See the references section for information on creating extension in earlier browsers.
Introduction
This article is a quick start for the creation of a new sidebar for Firefox. What we will do is create a sidebar and register it so it will be available in the menu. The goal is creating an empty sidebar that can be used as start for new sidebar applications.
Creating a sidebar requires some GUI creation and registration in the destination application. First a simple XUL page is created. Then the registration files are made and finally the sidebar is packed into an installable XPI file.
Pre-requisites
This article is a quick start, it won't explain all elements of XUL, packaging and XPI's. It's preferable you have some basic knowledge of how XUL works and how Firefox handles extensions. See Building an Extension for more detailed information about structuring, packaging, and deploying extensions.
Packages
Extensions to Firefox are installed with packages ("Bundles"). An extension package usually contains a "content" provider, which contains the XUL code and application logic. Optionally locales and skins can be included. Most additions are provided with a default tree structure, although not required it is recommended to use this structure. Here the package for the sidebar is created, the files included are listed below.
Example 1. Package structure
emptysidebar \- chrome |- content |- locale | \- en-US \- skin
Create all folders, except for skin
. It is not used for this tutorial.
The locale
holds the locale, only the en-US
locale is created. It is listed in Example 2. The locale includes the name and shortcut keys for the sidebar.