yekerui wrote:
Hi, Benjamin Smedberg:
I am porting an activeX control for IE onto mozilla plugin. With IE, it
is very simple to get the interface IWebBrowser2 at run time without
requiring javascript coding. Afterwards, I can use the interface
IWebBrowser2 to get URL address. At the end, my ActiveX control can restrict
domains for the sake of security. I want to do similar work with mozilla
browsers (firefox and netscape at least) from XPCOM/C++. It seems to me that
it is impossible to do such a work with mozilla browsers because of mozilla
limitations in integration.
I am looking foward to someone suggestions or hints how to solve such a
problem.
As this is a plugin issue I've set followup-to mozilla.dev.tech.plugins
only, let's continue this discussion there.
The NPAPI gives you the ability to get access to the nsIDOMWindow object
which contains the current plugin via the "NPNVDOMElement" enum[1] passed to
NPN_GetValue. This returns an addrefed nsIDOMElement[2] interface pointer
from which you can call .ownerDocument (on nsIDOMNode [3]), QueryInterface
that object to nsIDOM3Document[4], and call .documentURI.
1) http://lxr.mozilla.org/mozilla/source/modules/plugin/base/public/npapi.h#420
2)
http://lxr.mozilla.org/mozilla/source/dom/public/idl/core/nsIDOMElement.idl
3)
http://lxr.mozilla.org/mozilla/source/dom/public/idl/core/nsIDOMNode.idl#82
4)
http://lxr.mozilla.org/mozilla/source/dom/public/idl/core/nsIDOM3Document.idl#63
--BDS
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom