Revision Content

XULRunner applications, extensions, and themes all share a common directory structure, and in some cases the same bundle can be used as a standalone XULRunner application as well as an installable application extension.

Of course, an extension need not (and normally won't) have all of these directories. Themes are limited for security reasons, and can normally only provide a chrome.manifest which registers the theme and a JAR file.

Platform-specific subdirectories: Gecko 1.9.2.x and earlier

{{ gecko_callout_heading("2.0") }}

Platform-specific subdirectory support was removed in Gecko 2.0 {{ geckoRelease("2.0") }}. See the section Platform-specific files to learn how to use platform-specific files.

In some cases a single extension or application may wish to include binary component or plugins for multiple platforms, or theme authors might want to include multiple platform-specific JAR files. To facilitate the first case, the extension/app loader has special sub-directories specifically for platform-specific files (starting with Toolkit/Gecko 1.8, Firefox/Thunderbird 1.5). The platform string is defined during the toolkit build process to a value unique for the combination of operating system, processor architecture and compiler. The format of the platform string is:

All of the files which are loaded from the main extension directory are loaded from the subdirectory

/platform/{platform string}

if it exists. For example, if a plugin vendor wanted to make a plugin available for consumer computers running Linux(of the form: /platform/Linux*/), Macintosh(of the form: /platform/Darwin*/), and Windows(of the form: /platform/WIN*/), it would provide the following files:

The app/extension loader processes the base directory first, followed by the applicable platform directories (first /{OS_TARGET}/, then /{OS_TARGET}_{TARGET_XPCOM_ABI}/). When default preferences are defined in several directories, the ones loaded later overwrite the earlier ones.

Platform-specific files

Gecko 2.0 {{ geckoRelease("2.0") }} removed support for platform-specific subdirectories. Instead, you need to use manifest flags, such as the OS and ABI flags, in your chrome manifest to specify components that should be loaded for specific platforms.