The sink is not enough...

csharp Kuwait
  • 15 years ago

    This is in reference to a previous post:

    I thought I had solved it, but the NavigateError event does not fire for javascript errors.  Does anyone have any other ideas on how to trap javascript errors programmatically for the webbrowser object??




  • 15 years ago

    The following property is *supposed* to catch script errors at runtime:

    webBrowser.Document.Window.Error += new handler blurb

    But it doesn't :(

    It can only be attached AFTER the document has loaded and the DocumentCompleted event fires *after* IE has issued all of it's javascript error dialogs :(

    Subclassing the browser hasn't helped and if I use the SuppressScriptErrors property, then I will have no chance of catching them!

    Any ideas???


  • 14 years ago

    I just had a similar problem with a VB.NET application that I am working on which uses the WebBrowser control.

    Set the property:

    WebBrowser.ScriptErrorsSuppressed = True

    in the method that handles the event WebBrowser.DocumentCompleted.

    After doing this I have not encountered any javascript error popups.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” - Tom Cargill