TOC PREV NEXT INDEX

domref



window.Components


Returns a reference to the XPCOM components that are installed in Mozilla/Netscape.

Syntax

componentList = window.Components
 

Parameters

componentList is a read-only array of XPCOM components accessible via XPConnect.

Example

// use the Components property to get a particular class
 
// and a related interface
 
var cp = Components.classes['@mozilla.org/preferences;1']
 
var icp = Components.interfaces.nsIPref;
 

Notes

The Components property does not work from HTML and XML pages loaded as content in the browser (i.e., it returns "[object nsXPCComponents]", which can't be further interrogated), since those pages are not typically considered part of the trusted application chrome and content that can use XPConnect. From trusted scripts, however, Components can be used to get and use the XPCOM objects which the browser itself uses for its internal functionality, as in the example above.

See the following document for more information about the Components object:

Specification

DOM Level 0. Not part of specification.
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX