469,275 Members | 1,718 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Removing modeless dialog from WebBrowser control.

I've found that if a MessageBox (called by alert/confirm from
Javascript) or a web page modeless dialog is popped up, I cannot call
Navigate of the WebBrowser control. If I do, a COM exception occures.

How can I disable javascript MessageBoxes or modeless dialogs? I
disabled normal popup windows by adding e.Cancel=true at the browsers
newwindow event. But I couldn't disable modeless dialog or javascript
MessageBox. I tried to remove some specific javascript code by

WebBrowser.DocumentText=WebBrowser.DocumentText.Re move("alert(","//alert(");

at the WebBrowser's DocumentComplete event, but this caused endless
loop. I guess if I modify the DocumentText, DocumentComplete is called
again.

So, what is the recommended way?

Jan 15 '07 #1
0 1684

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Rikkert | last post: by
1 post views Thread by Carmine | last post: by
reply views Thread by Andrew | last post: by
1 post views Thread by andrew | last post: by
8 posts views Thread by proit_123 | last post: by
3 posts views Thread by AboutJAV | last post: by
3 posts views Thread by DoB | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.