The Components object is the object through which XPConnect functionality is reflected into JavaScript. The Components object is actually a native instance of the nsIXPCComponents
interface which is reflected into JavaScript as a top level object using XPConnect.
Some properties of Components require advanced privileges and may not work in web pages.
The Components object has the following members:
| Member | Description |
|---|---|
classes |
array of classes by ContractID |
classesByID |
array of classes by CID |
Constructor |
constructor for constructor of components |
Exception |
constructor for XPConnect exceptions |
ID |
constructor for XPCOM nsIDs |
interfaces |
array of interfaces by interface name |
interfacesByID |
array of interfaces by IID |
isSuccessCode |
function to determine if a given result code is a success code |
lastResult |
result code of most recent XPConnect call |
manager |
the global XPCOM component manager |
results |
array of known result codes by name |
returnCode |
pending result for current call |
stack |
current JavaScript call stack |
utils |
provides access to several useful features |
utils.evalInSandbox |
Runs JavaScript code in a sandbox, usually used to run code with restricted privileges. |
utils.forceGC |
Requires Gecko 1.9 Forces a garbage collection cycle. |
utils.getWeakReference |
Requires Gecko 1.9 Gets a weak reference for the object passed in. |
utils.import |
Requires Gecko 1.9 Loads a JS module into the current script, without sharing a scope. |
utils.lookupMethod |
Looks up a native (i.e. declared in the interface) method or property of an XPCOM object. Serves the same purpose as XPCNativeWrapper. |
utils.reportError |
Reports a JavaScript Error object to the Error Console. |
utils.Sandbox |
Creates sandbox objects for use with evalInSandbox. |
Page last modified 11:01, 3 Nov 2007 by Mgjbot