[[XPCOM | http://developer.mozilla.org/en/docs/XPCOM ]]
XPCOM is a cross platform component object model, similar to Microsoft COM. It has multiple language bindings, letting the XPCOM components be used and implemented in JavaScript, Java, and Python in addition to C++. Interfaces in XPCOM are defined in a dialect of IDL caled XPIDL.
XPCOM itself provides a set of core components and classes, e.g. file and memory management, threads, basic data structures (strings, arrays, variants), etc. The majority of XPCOM components is not part of this core set and is provided by other parts of the platform (e.g. Gecko or Necko) or by an application or even by an extension.
!Referencias
[[JavaXPCOM| http://developer.mozilla.org/en/docs/JavaXPCOM ]]
[[XPConnect|http://developer.mozilla.org/en/docs/XPConnect]]
[[How to Build an XPCOM Component in Javascript|http://developer.mozilla.org/en/docs/How_to_Build_an_XPCOM_Component_in_Javascript]]
/*{{{*/
try {
// this is needed to generally allow usage of components in javascript
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var myComponent = Components.classes['@dietrich.ganx4.com/helloworld;1']
.createInstance(Components.interfaces.nsIHelloWorld
);
alert(myComponent.hello());
} catch (anError) {
alert("ERROR: " + anError);
}
/*}}}*/
Ver también... [[Implementing XPCOM components in JavaScript|http://kb.mozillazine.org/Implementing_XPCOM_components_in_JavaScript]]