在扩展的web浏览器NewWindow3事件 [英] NewWindow3 event on extended WebBrowser

查看:1491
本文介绍了在扩展的web浏览器NewWindow3事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个扩展的WebBrowser控件它处理NewWindow3事件。本来我想这是因为它暴露了Url属性。

I've got an extended WebBrowser control which handles the NewWindow3 event. Originally I wanted this because it exposes the Url property.

我想发生在这个NewWindow事件是取消打开一个新的IE实例(所以我设置 E.Cancel = TRUE)。然后,我想创建一个新的形式,新的Web浏览器控件并导航到E.Url

What I want to happen in this NewWindow event is to cancel opening a new IE instance (so I set E.Cancel = True). Then, I want to create a new form, a new web browser control and navigate to E.Url

这类作品。在那里我遇到了问题,是一些JavaScript。如果我浏览到一个网页,需要访问它的揭幕战(在这种情况下,写入一个文本框),它得到一个JavaScript错误。

This sort of works. Where I'm running into problems, is with some JavaScript. If I navigate to a page that needs to access it's opener (in this case, to write to a text box), it gets a JavaScript error.

在这里我的猜测是,这是因为 WebBrowser.Document.Window.Opener 未设置。

My guess here is that this happens because the WebBrowser.Document.Window.Opener isn't set.

我能做些什么,以确保这个设置?我试了几件事情,包括设置ppDisp对象到我的新web浏览器对象,但没有喜悦也。

What can I do to make sure this is set? I've tried a couple of things including setting the ppDisp object to my new WebBrowser object but no joy there.

编辑为pre制止:我试过GeckoFX,这似乎有一个bug在重新发送POST数据。它的报道但尚未确认。我也试着WebKit.NET这似乎不错,但有点不完整的。

Editing as a pre-empt: I've tried GeckoFX, and that seems to have a bug in it on resending POST data. It's been reported but not acknowledged. I've also tried WebKit.NET which seems good but a little incomplete.

推荐答案

这篇文章介绍了如何处理这个事件的 http://blogs.artinsoft.net/mrojas/archive/2009/08/07/newwindow3.aspx

This post explains how to handle this event http://blogs.artinsoft.net/mrojas/archive/2009/08/07/newwindow3.aspx

这篇关于在扩展的web浏览器NewWindow3事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆