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?