On 4 Aug., 16:55, Boris Zbarsky <[email protected]> wrote: > ra wrote: > > var myplugin = document.getElementById("myId"); > > myplugin.func(25); > > This is done by adding the scriptable plug-in's JS object to the > prototype chain of the element's JS object. See > nsHTMLPluginObjElementSH::SetupProtoChain in nsDOMClassInfo.cpp. > > > nsCOMPtr<nsIMyPlugin> myplugin = do_QueryInterface(elem, &rv); > > > In the last line I can't query the interface. The return value rv is > > 0x80004002 (NS_NOINTERFACE). But the interface is there, since it is > > callable from java-script. > > Not at all. The interface is in fact not there on the element itself. > > -Boris
Thanks for the hint Boris. nsDOMClassInfo.cpp was a good starting point for code reading. Although there is no nsHTMLPluginObjElementSH::SetupProtoChain in gecko 1.8.1 (forgot to mention I'm embedding gecko 1.8.1) but i found nsHTMLExternalObjSH::GetPluginInstance. After some head-scratching I found out the following: nsIObjectFrame has a GetPluginInstance method returning a nsIPluginInstance from where i can get my custom (nsIMyPlugin) interface. The nsIObjectFrame interface can be QId from nsHTMLObjectElement. And here I'm stuck again. How do I get nsHTMLObjectElement from nsIDOMElement or nsIDOMNode? Is there a way? regards, Rainer _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
