How can I access the JavaScript global object ("window") inside an embedded browser object (the IWebBrowser2 interface)?
I have an HTML page which embeds an IWebBrowser2 ActiveX (i.e. the control is essentially an Internet Explorer browser). I need to write JavaScript in this HTML page which will remove any window.onresize handler from the page loaded in the IWebBrowser2 control.
IWebBrowser2 exposes the DOM through IWebBrowser2::Document, but this is equivalent to window.document. Is there any way I can get access to window or window.onres开发者_如何学JAVAize?
You should be able to use document.parentWindow:
var controlWindow = control.document.parentWindow;
精彩评论