Installing extensions

Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons. Use WebExtensions instead. If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions.

From Firefox 53 onwards, no new legacy add-ons will be accepted on addons.mozilla.org (AMO).

From Firefox 57 onwards, WebExtensions will be the only supported extension type, and Firefox will not load other types.

Even before Firefox 57, changes coming up in the Firefox platform will break many legacy extensions. These changes include multiprocess Firefox (e10s), sandboxing, and multiple content processes. Legacy extensions that are affected by these changes should migrate to WebExtensions if they can. See the "Compatibility Milestones" document for more.

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.

If you are developing a native tool or application which ships with an associated extension for toolkit-based application, such as Firefox, your native tool can initiate the extension installation by copying the extension into a predefined directory on the user's computer.  The next time that the toolkit-based application (Firefox) is launched, the user will be asked to approve of the installation, and if the user approves, the extension will be automatically loaded for subsequent launches.  If the user has more than one profile, the approval and installation will occur on the next launch of each profile.

Important: No automatic updates will be performed for extensions installed in this way.  Since the extension's files are installed by an native tool, the application expects the native tool to handle performing updates. However, automatic compatibility checks are still performed. 

You must know and use your extension's ID.  For WebExtensions based add-ons, the ID is the value of the applications.gecko.id property within the manifest.json file.  For legacy extensions, the ID is defined in the install.rdf of the extension, between the <em:id></em:id> tags.  Example: {2947c399-a811-3902-82a6-b02634837f8e}

If the extension does not require extraction to work correctly, you may simply copy the extension's xpi to one of the destination folders described below.  All WebExtensions based add-ons do not require being unpacked.  The name of the copied file must be the extension's ID, including the curly brackets, followed by .xpi.   Example filename: {2947c399-a811-3902-82a6-b02634837f8e}.xpi

If your extension needs to be extracted/unpacked,  you should extract the extension to a directory with the same name as the the extension's ID, including the curly brackets, and copy that directory.  Example directory name: {2947c399-a811-3902-82a6-b02634837f8e}  In addition, you must find a line in the install.rdf file that defines unpack as true (e.g. <em:unpack>true</em:unpack>).

If you are developing an extension for Firefox you can use an extension proxy file, which you can use to install an extension without copying the files over to the folders below.

In what follows,

  • <appname> is the name of the application you're installing the extension for.  Example: Firefox
  • <appid> is the ID of the application you're installing the extension for.  Example (for Firefox): {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 
  • <vendor> is the provider of the application you're installing the extension for.  Example:  Mozilla
  • <extensionId> is the ID of your extension, including the curly brackets.  Example: {2947c399-a811-3902-82a6-b02634837f8e}

Windows

Note: Extensions installed to this location will be disabled by default and will be available for all applications with the <appid>.

To install an extension to this location, create a folder with the <appid> in the Extensions folder if it doesn't exist and put your extension folder with the extension's id or proxy file in that folder:

%appdata%\<vendor>\Extensions\<appid>\

For example, for a Firefox extension, that means:

%appdata%\Mozilla\Extensions\{ec8030f7-c20a-464f-9b0e-13a3a9e97384}\<extensionid>\

%appdata% is a system variable pointing to C:\Documents and Settings\Dave\Application Data\ or C:\Users\Dave\AppData\Roaming\, depending on the Windows version.

macOS

To install an extension to be used by all profiles of all users on macOS, copy it to:

/Library/Application Support/<vendor>/Extensions/<appid>/

To install an extension for all profiles of a specific user, copy it to:

~/Library/Application Support/<vendor>/Extensions/<appid>/

Linux

To install an extension to be used by all users on Linux, copy it to:

/usr/lib/<vendor>/extensions/<appid>/

Or...

/usr/lib64/<vendor>/extensions/<appid>/

Or...

/usr/share/<vendor>/extensions/<appid>/

To install an extension just for a specific user:

~/.<vendor>/extensions/<appid>/

Example

For example, if you've created a standalone application for macOS that includes a plugin for Firefox, and you want your extension installed for all Firefox profiles of all macOS user accounts, your installer would extract its extensions files to the following folder:

/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/{dba45d40-f69e-11dc-95ff-0800200c9a66}

"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" is Firefox's application ID, "{dba45d40-f69e-11dc-95ff-0800200c9a66}" is the extension's ID.

In Firefox 4 if the extension can be installed unpacked then you can just copy the XPI to the directory rather than extracting it:

/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/{dba45d40-f69e-11dc-95ff-0800200c9a66}.xpi

Disabling install locations

In some circumstances you may want Firefox to ignore the additional install locations listed above. In this case you can set the preference extensions.enabledScopes to a value that defines which locations Firefox will use. Add up the values for the different locations listed below and set the preference to that (note that it is impossible to disable loading add-ons from the profile directory):

Value Install scope
1 The current users's profile.
2 All profiles of the logged-in user.
4 Installed and owned by Firefox.
8 Installed for all users of the computer.
15 The combination of all scopes.

Preventing automatic install from specific locations

Requires Gecko 8.0(Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)

Starting in Firefox 8 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5), you can configure Firefox to not automatically install add-ons from the add-on scopes listed in the table in Disabling install locations. Simply set the value of the preference extensions.autoDisableScopes to the sum of the values for each of the scopes you wish to disable. Setting the value to 0 disables this feature.

Bundling extensions with a custom Firefox

Starting with Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1), you can bundle extensions within a customized Firefox, and they will be installed automatically when the user starts up the application for the first time. See Customizing Firefox for details.

Document Tags and Contributors

 Last updated by: bunnybooboo,