the following code disable :
- Alert window.
- Print window
- confirm window.
/************Disable alert/print function()**********************/ HtmlElement head = WebBrowser1.Document.GetElementsByTagName("head")[0]; HtmlElement scriptEl = WebBrowser1.Document.CreateElement("script"); IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement; string alertBlocker = @"window.alert = function () { }; window.print=function () { }; window.confirm=function () { }; "; element.text = alertBlocker; head.AppendChild(scriptEl); WebBrowser1.ScriptErrorsSuppressed = true; /****************************************************************/
Enjoy!