Registers chrome with the chrome registry.
int registerChrome( SWITCH, srcDir, xpiPath);
registerChrome method has the following parameters:
SWITCHis the chrome switch indicating what type of file is being registered.
SKINis used to register skins,
LOCALEis used to register language packs.
PACKAGE, a third possibility is the equivalent of
SKIN AND/OR LOCALE, and ensures that everything in the XPI is registered. One final option for the switch parameter is
DELAYED_CHROME, which registers the switch only after a relaunch of the browser.
Note that you can combine switches as in the example below.
FileSpecObjectrepresenting the source destination of the installation. FileSpecObjects like that required by this function are created using the getFolder method on the Install object.
xpiPathis the path within the XPI in where the contents.rdf file defining the chrome is located. For example, "locale/myLocale/aim," points to the
locale/myLocale/aimsubdirectory of the same XPI file in which the installation script is located.
An integer error code. For a list of possible values, see Return Codes. In some situations the method may return other errors. In a few cases you may get a registry error.
When the third parameter is omitted (pointing to a specific location within the XPI file), this function is being used in a somewhat deprecated way. In this case,
registerChrome is supporting the old format of installation archives, in which the manifest.rdf file was always located at the highest level of the installation archive. In this case, registerChrome does not require a path inside the archive, as it does now in order to locate the more flexible contents.rdf format of installation archives. Note that you can also look in the installed-chrome.txt file in the chrome directory to see how and where the
registerChrome function has registered your package with the chrome registry.
Example assumes your XPI file is in Plugins folder and RDF file is in resources subfolder of XPI.
You should probably avoid this call (in the case you are copy/pasting from older install scripts) for plugin installation in Firefox 2.x. It is unclear what, if anything, does this "Chrome registration" accomplish.
registerChrome( PACKAGE | DELAYED_CHROME, getFolder("Plugins"), "resources");