Compare Revisions

How to build an XPCOM component in Javascript

Revision 38177:

Revision 38177 by Tomsky on

Revision 38178:

Revision 38178 by Tomsky on

Title:
How to build an XPCOM component in Javascript
How to build an XPCOM component in Javascript
Slug:
How_to_Build_an_XPCOM_Component_in_Javascript
How_to_Build_an_XPCOM_Component_in_Javascript
Tags:
NeedsTechnicalReview, Extensions, Add-ons, XPCOM
NeedsTechnicalReview, Extensions, Add-ons, XPCOM
Content:

Revision 38177
Revision 38178
nn212try {
213        // this is needed to generally allow usage of components 
 >in javascript
214        netscape.security.PrivilegeManager.enablePrivilege("Unive
 >rsalXPConnect");
215 
212var myComponent = Components.classes['@dietrich.ganx4.com/hellowo216        var myComponent = Components.classes['@dietrich.ganx4.com
>rld;1']>/helloworld;1']
213                            .createInstance(Components.interfaces217                                    .createInstance(Components.in
>.nsIHelloWorld);>terfaces.nsIHelloWorld);
t215alert(oMyComponent.hello());t219        alert(myComponent.hello());
220} catch (anError) {
221        alert("ERROR: " + anError);
222}

Back to History