0

Ok so I have a WebBrowser called wb. And I load a page into wb using wb.Navigate("url"); When the page loads I get a box saying "Script Error".

Here is the one I get
The Error I get

How can I keep this from popping up in my program?

ThatBenderGuy
  • 307
  • 1
  • 6
  • 15
  • possible duplicate of [Disable JavaScript error in WebBrowser control](http://stackoverflow.com/questions/2476360/disable-javascript-error-in-webbrowser-control) – Gabe Apr 25 '12 at 13:05
  • 1
    Search for your solution instead of asking new questions... http://stackoverflow.com/questions/2476360/disable-javascript-error-in-webbrowser-control – Jonathan Apr 25 '12 at 12:55

2 Answers2

10

Not sure on newer browser control, but off the top of my head, there is an option called SuppressScriptErrors or something like that. Set that to true in your code before performing work. You'll also have to make sure that under Internet Options that debugging web pages is off (if you're getting the dialog above, it is off).

http://www.dev102.blogspot.com/2007/12/how-to-suppress-disable-script-errors.html

wb.ScriptErrorsSuppressed = true;
Derreck Dean
  • 3,708
  • 1
  • 26
  • 45
0

The method ScriptErrorsSuppressed referenced above is not supported in the webBrowser control in .Net 6 and higher.

webBrowser1.ScriptErrorsSuppressed = true;

we need to build a handler and override the default script error window.

Fedor
  • 17,146
  • 13
  • 40
  • 131
Rich D.
  • 1
  • 2