使用 window.open 和 WebBrowser 控件调整 Javascript 大小
我正在使用 WPF WebBrowser 控件并使用以下代码处理 NewWindow3 事件:
IServiceProvider serviceProvider = (IServiceProvider)webBrowser.Document;
Guid serviceGuid = SID_SWebBrowserApp;
Guid iid = typeof(SHDocVw.WebBrowser).GUID;
SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)serviceProvider.QueryService(ref serviceGuid, ref iid);
wb.NewWindow3 += new SHDocVw.DWebBrowserEvents2_NewWindow3EventHandler(wb_NewWindow3);
如何在使用 window.open 导航时处理 javascript 调整大小,如下所示:
window.open('Sample.htm',null,'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no');
是否有办法在 NewWindow3 事件处理程序中获取调用者请求的高度和宽度?
I'm using WPF WebBrowser control and handling NewWindow3 events using following code:
IServiceProvider serviceProvider = (IServiceProvider)webBrowser.Document;
Guid serviceGuid = SID_SWebBrowserApp;
Guid iid = typeof(SHDocVw.WebBrowser).GUID;
SHDocVw.WebBrowser wb = (SHDocVw.WebBrowser)serviceProvider.QueryService(ref serviceGuid, ref iid);
wb.NewWindow3 += new SHDocVw.DWebBrowserEvents2_NewWindow3EventHandler(wb_NewWindow3);
How to handle javascript resizing when navigating using window.open, something like this:
window.open('Sample.htm',null,'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no');
Is there anyway to get height and width requested by caller in NewWindow3 event handler?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
否,但您可以将值保存在 INewWindowManager:: EvaluateNewWindow 实现并稍后使用这些值。可以在 http://code.google 中找到示例。 com/p/csexwb2/source/browse/trunk/cEXWB.cs
No, but you can save the values in your INewWindowManager::EvaluateNewWindow implementation and use the values later. An example can be found at http://code.google.com/p/csexwb2/source/browse/trunk/cEXWB.cs