Labs/Jetpack/Binary Components

From MozillaWiki
< Labs‎ | Jetpack
Revision as of 18:47, 28 July 2009 by Avarma (talk | contribs) (Added API section)
Jump to navigation Jump to search

nsJetpack

nsJetpack is a binary component used to provide services to Jetpack that aren't otherwise available to scripted chrome code in the Mozilla platform.

Accessing the Component

Because the goal of nsJetpack is to provide functionality to scripted code, and because much of its functionality is concerned with providing access to SpiderMonkey internals, the XPCOM interface for the component is rather trivial. To obtain the component, simply do:

 var nsJetpack = Cc["@labs.mozilla.com/jetpackdi;1"]
                 .createInstance(Ci.nsIJetpack).get();

This will give you the nsJetpack native JavaScript object, which provides access to all the component's functionality.

API

nsJetpack.wrap()

nsJetpack.unwrap()

nsJetpack.getWrapper()

nsJetpack.profileMemory()

nsJetpack.functionInfo()

nsJetpack.seal()