nsIChromeRegistry

This article needs a technical review. How you can help.

Provides access to the chrome registry; you can use this to get information about chrome documents that have been registered.
Inherits from: nsISupports Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

Implemented by: @mozilla.org/chrome/chrome-registry;1 as a service:

var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                     .getService(Components.interfaces.nsIChromeRegistry);

Method overview

void canonify(in nsIURI aChromeURL); Obsolete since Gecko 1.8
void checkForNewChrome();
nsIURI convertChromeURL(in nsIURI aChromeURL);
boolean wrappersEnabled(in nsIURI aURI); Violates the XPCOM interface guidelines

Constants

Constant Value Description
NONE 0  
PARTIAL 1  
FULL 2  

Methods

Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)

canonify()

Note: This method is obsolete; use convertChromeURL() instead.

Converts a chrome URL into a canonical representation by ensuring that the filename portion of the URL is included, as in chrome://package/provider/file. This is useful because chrome URLs are allowed to be specified in "shorthand", leaving the "file" portion off. In that case, the URL is expanded to chrome://package/provider/package.ext.

The extension, ext, is one of:

xul
For a "content" package.
css
For a "skin" package.
dtd
For a "locale" package.
void canonify(
  in nsIURI aChromeURL
);
Parameters
aChromeURL
The URL that is to be canonified.

checkForNewChrome()

Refreshes the chrome list at runtime, looking for new packages and so forth.

void checkForNewChrome();
Parameters

None.

convertChromeURL()

Resolves a chrome URL to an loadable URI using the information in the registry. A new nsIURI is returned; the original is left unmodified.

This lets you take a non-canonical chrome URI, such as chrome://package/provider/file, and convert it into a canonical one. This is useful because chrome URLs are allowed to be specified in "shorthand", leaving the "file" portion off. In that case, the URL is expanded to chrome://package/provider/package.ext.

The extension, ext, is one of:

xul
For a "content" package.
css
For a "skin" package.
dtd
For a "locale" package.
nsIURI convertChromeURL(
  in nsIURI aChromeURL
);
Parameters
aChromeURL
The URL that is to be converted.
Return value

A new nsIURI object containing the loadable URI for the specified chrome URL.

Violates the XPCOM interface guidelines

wrappersEnabled()

Returns whether XPCNativeWrappers are enabled for the specified URI.

boolean wrappersEnabled(
  in nsIURI aURI
);
Parameters
aURI
The URI for which to determine if XPCNativeWrappers are enabled.
Return value

true if XPCNativeWrappers are enabled for the specified URI; otherwise false.

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, kscarfone
 Last updated by: Sheppy,