Sergej Marsnjak wrote: > Thanks for answer, but it's not enough for me. > > The .js sample just calls C++ methods from javaScript.
Just to be clear ... Here's the C++ implementation of the nsISample interface. http://lxr.mozilla.org/seamonkey/source/xpcom/sample/nsSample.cpp Here's the JS implementation of same ... http://lxr.mozilla.org/seamonkey/source/xpcom/sample/nsSample.js So there really are two different implementations of the same component. Oops! Sorry, I just looked at the JS source. It does indeed have a different contract ID - "@mozilla.org/jssample;1" so you can have ... var sample = Components.classes["@mozilla.org/sample;1"].createInstance(); sample = sample.QueryInterface(Components.interfaces.nsISample); ... and also have ... var sample = Components.classes["@mozilla.org/jssample;1"].createInstance(); sample = sample.QueryInterface(Components.interfaces.nsISample); -rick
