Put your logo here!

TOC PREV NEXT



registerChrome

Registers chrome with the chrome registry.

Method of

Install

Syntax

 int registerChrome(
  SWITCH, 
  srcDir, 
  xpiPath); 

Parameters

The registerChrome method has the following parameters:

SWITCH SWITCH is the chrome switch indicating what type of file is being registered. SKIN is used to register skins, LOCALE is 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.
srcDir srcDir is a FileSpecObject representing the source destination of the installation. FileSpecObjects like that required by this function are created using the getFolder method on the Install object.
xpiPath xpiPath is the path within the XPI in where the contents.rdf file defining the chrome is located. "locale/myLocale/aim," for example, points to the locale/myLocale/aim subdirectory of the same XPI file in which the installation script is located.

Returns

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.

Description

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

From one of the browser installation files, in which the main communicator archive (browser.xpi) is registered:

 registerChrome(
  CONTENT | DELAYED_CHROME,
  getFolder(cf,"browser.xpi"),
  "content/editor/"); 

Netscape Communications
devedge.netscape.com
TOC PREV NEXT