Visit Mozilla.org

Installing extensions

From MDC

Introduced in Gecko 1.9


If you're putting together an installer that needs to be able to install extensions for a toolkit-based application, such as Firefox or anything using XULRunner, Gecko 1.9 (Firefox 3) introduces an easy way to do this for Mac OS X and Linux. Windows users have had the ability to install extensions using the registry for some time.

Now, on Mac OS X and Linux, you can simply copy the extension into a predefined directory on the user's computer.

Note that extensions installed using this method are installed in all profiles for the given application, new and pre-existing.

Contents

[edit] Mac OS X

To install an extension to be used by all users on Mac OS X, copy it to:

/Library/Application Support/Mozilla/Extensions/appid

To install an extension just for a specific user, place it in that user's library folder hierarchy:

~/Library/Application Support/Mozilla/Extensions/appid

[edit] Linux

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

/usr/lib/mozilla/extensions/appid

Or...

/usr/lib64/mozilla/extensions/appid

Or...

/usr/share/mozilla/extensions/appid

To install an extension just for a specific user:

~/.mozilla/extensions/appid

[edit] Access

You can either drop the xpi file into the directory described above, or you can extract the xpi into a folder named after the extension's id.

If you do not extract the extension into a folder, then:

  • The first user with write access to the containing directory will be prompted to install the extension upon the next run of the application.
  • If a user does not have write privileges for the containing directory, the extension will not be available, as it cannot be extracted.
  • However, if a user with write privileges runs the application and installs the extension, subsequent unprivileged users will then have it as well.

Unzipped extensions are installed silently to all users regardless of privileges.

[edit] Example

For example, if you've created a standalone application for Mac OS X that includes a plugin for Firefox, your installer would copy the extension into the following folder, creating it if it doesn't already exist:

/Library/Application Support/Mozilla/Extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}

"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" is Firefox's application ID.

Then copy the extension's xpi file to that directory or unzip it into a folder named after the extension's id:

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

"{dba45d40-f69e-11dc-95ff-0800200c9a66}" is the extension's id.