I have a .NET 2.0 WebBrowser control used to navigate some pages with no user interaction (don\'t ask...long story). Because of the user-less nature of thi
The easiest way to do this is :
In the : Webbrowser Control you have the procedure ( standard ) BeforeScriptExecute
( The parameter for BeforeScriptExecute is pdispwindow )
Add this :
pdispwindow.execscript("window.alert = function () { }")
In this way before any script execution on the page window alert will be suppressed by injected code.