471,612 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,612 software developers and data experts.

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 1786

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
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.