C# webBrowser script error

as this link answer:

you must only add this line:

webBrowser.ScriptErrorsSuppressed = true;

The script errors happen all of the time in the integrated Internet Explorer WebBrowser control even when it's using version 11. Modern websites rely heavily on massive Javascript files and dynamic rendering. You can see that just by watching that page load in a regular browser. The control just can't cut it some of the times.

You might want to try some alternative browser controls. There are no guarantees that it will work with any of them, but at least it's something to try.

  • Awesomium : Originally based on Chromium. I don't know if they still integrate Chromium changes or if they've gone in their own direction. It's free for personal use as well as commercial making less than $100k.
  • DotNetBrowser : Embed a Chromium-based WPF / WinForms component into your .NET application to display modern web pages built with HTML5, CSS3, JavaScript, Silverlight etc.
  • geckofx : An open-source component for embedding Mozilla Gecko (Firefox) in .NET applications.
  • Xilium.CefGlue : A .NET/Mono binding for The Chromium Embedded Framework (CEF) by Marshall A. Greenblatt.
  • BrowseEmAll : BrowseEmAll.Cef (Chrome), BrowseEmAll.Gecko (Firefox), BrowseEmAll Core API (Chrome,Firefox,IE - COMMERCIAL)

There are probably others, but this should give you a start with some of the more popular active projects if you want to pursue this route.


The WebBrowser control is capable of rendering most web pages, but by default it attempts to render pages in compatibility mode (pretty much IE7, hence the issues). If you are building your own page, it's simple, just add the following tag to the header and it should render fine...

<meta http-equiv="X-UA-Compatible" content="IE=Edge" />

However, if you are trying to render a third party site you cannot add tags to, things get more difficult. As mentioned above, you can use a registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION) if it's just on your own machine.

If neither of these options are a possible solution, using a different browser control (again, great suggestions above) is pretty much your only option.

There's a great blog on controlling the browser control compatibility mode at https://docs.microsoft.com/en-gb/archive/blogs/patricka/controlling-webbrowser-control-compatibility