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?

2

2 Answers 2

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;
Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.