Click here to Skip to main content
15,665,942 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I had developed a web browser project, which one is allow https site's only. When loading my site Some script error message popup is came. For this problem i give the below line,
browser.ScriptErrorsSuppressed = true;

then script error suppressed but the https site is not loding, so i tried another coding,that is given below,
// Hides script errors without hiding other dialog boxes.
private void SuppressScriptErrorsOnly(WebBrowser browser)
  // Ensure that ScriptErrorsSuppressed is set to false.
  browser.ScriptErrorsSuppressed = false;

  // Handle DocumentCompleted to gain access to the Document object.
  browser.DocumentCompleted +=
    new WebBrowserDocumentCompletedEventHandler(

private void browser_DocumentCompleted(object sender, 
  WebBrowserDocumentCompletedEventArgs e)
  ((WebBrowser)sender).Document.Window.Error += 
    new HtmlElementErrorEventHandler(Window_Error);

private void Window_Error(object sender, 
  HtmlElementErrorEventArgs e)
  // Ignore the error and suppress the error dialog box. 
  e.Handled = true;

then also i get that script error message popup is shown.

And i tried using IE->Tools->InternetOptions->Advanced
then unchecked display a notification about every script error.
what my need is the script error is minimized auotomatically and script error icon is showing in status bar like IE(Script error are shown in status bar).

Please help me....!
Thanks in advance....!

1 solution

See the answer from OriginalGriff here: i had doubt in web browser control about Script-error[^]. Please do not repost.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900