XUL Platform-specific Subdirectories
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
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:
Because XPT files are not platform-specific, any associated XPT files would go in the generic components directory:
If an extension has non-binary platform-specific code (such as code which uses the windows registry from script), it can also use just the operating system identifier as a platform-subdirectory:
When platform-specific JAR files are used, each platform directory should have its own chrome.manifest file:
The app/extension loader processes the base directory first, followed by the applicable platform directories (first /{OS_TARGET}/, then /{OSTARGET}_{TARGETXPCOM_ABI}/). When default preferences are defined in several directories, the ones loaded later overwrite the earlier ones.
See Also XUL_Bundle_Structure
{OSTARGET}_{TARGETXPCOM_ABI}
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:
/platform/Linux_x86-gcc3/plugins/libMyPlugin.so /platform/WINNT_x86-msvc/plugins/MyPlugin.dll /platform/Darwin_ppc-gcc3/plugins/libMyPlugin.dylib
Because XPT files are not platform-specific, any associated XPT files would go in the generic components directory:
/components/MyPlugin.xpt
If an extension has non-binary platform-specific code (such as code which uses the windows registry from script), it can also use just the operating system identifier as a platform-subdirectory:
/platform/WINNT/components/registerDoctype.js
When platform-specific JAR files are used, each platform directory should have its own chrome.manifest file:
chrome.manifest chrome/mytheme-base.jar platform/Darwin/chrome.manifest platform/Darwin/chrome/mytheme-mac.jar platform/WINNT/chrome.manifest platform/WINNT/chrome/mytheme-win.jar
The app/extension loader processes the base directory first, followed by the applicable platform directories (first /{OS_TARGET}/, then /{OSTARGET}_{TARGETXPCOM_ABI}/). When default preferences are defined in several directories, the ones loaded later overwrite the earlier ones.
See Also XUL_Bundle_Structure