Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Migrating raw components to add-ons

Historically, Firefox has allowed third party contributions to be added to the application's components/ directory, but beginning with Firefox 3.6, this is no longer permitted. Components added in this way are invisible to users and cannot be managed through the Firefox add-ons manager. What's worse, though, is that these components don't have a mechanism for specifying the versions of Firefox with which they are compatible, leading to poor integration and instability as users upgrade their Firefox installations.

The Firefox extension mechanism allows you to do everything that you could do through direct component drops, but also gives you and your users extra flexibility and more sophisticated versioning support. As we roll this new behavior out, this document will be updated with additional information addressing scenarios we see developers encountering.

Simple migration

If your goal is just to get your raw component working properly as an extension, you can do this in three steps:

  1. Create a new add-on using the instructions here. As you'll see, add-ons give you much more flexibility than simply loading a component, but in order to get started, all you'll need is your directory structure and install manifest.
  2. Create a components/ directory in the root of your add-on's directory.
  3. Add your JS and binary components within that directory. They will be registered the first time Firefox is run once your add-on is installed.

Automatic installation

Once you have an add-on packaged, users can install it by visiting your site and giving the add-on permission to install. Many software authors install Firefox components as a by product of their own software installs, though. If you would like to install Firefox add-ons in an automated, programmatic way, we have documented a set of best practices.

JavaScript C-Types

Some add-on authors create binary components not because they want to interact with Firefox at the C++ level, but strictly so that they can make use of third party DLLs. If this is the only reason you are using a binary component instead of JavaScript, take a look at the new JavaScript C-Types support introduced in Firefox 3.6. It allows JavaScript code to load functions from DLLs on windows, and should allow you to eliminate your dependence on binary components entirely. This leads to a better compatibility path as new versions of Firefox are released.

Document Tags and Contributors

 Contributors to this page: Johnath, Sheppy
 Last updated by: Johnath,