What I would like to do is to call some function of it from the extension, something like :
Code: Select all
var f = Components.classes["@mozilla.doslash.org/test/component;1"].getService(Components.intefaces.nsIsupports);
f.init();
I saw in noscript that it is possible to call all the functions from the component by defining a wrapper in the component :
Code: Select all
get wrappedJSObject () {
return this;
}
and by calling the component that way :
Code: Select all
var f = Components.classes["@mozilla.doslash.org/test/component;1"].getService(Components.intefaces.nsIsupports).wrappedJSObject;
f.init();
I'm not sure, but I think it is possible to do that in some other way, for example to define which functions are accessible from outside the component, and which are not. I tried to find informations about the meaning of get but couldn't find. Has anyone some clue or pointer to a documentation that could help me (I tried to read the book about component creation, but, as I don't known C++ at all, that didn't help me much)
thanx