8

How could I disable javascript entirely on WebBrowser in WinForms?

bevacqua
  • 47,502
  • 56
  • 171
  • 285
  • 1
    possible duplicate of [VB.NET WebBrowser disable javascript](http://stackoverflow.com/questions/4164061/vb-net-webbrowser-disable-javascript) – Ash Burlaczenko May 16 '12 at 17:37
  • The WebBrowser control is part of the .net framework so this is a duplicate. – Ash Burlaczenko May 16 '12 at 17:38
  • You can but is pain. See [here](http://stackoverflow.com/questions/3443425/c-sharp-stop-webbrowser-control-from-loading-images-flash-script-etc). – Juan Aug 21 '12 at 21:04
  • I'm sure you must have a temptation to simply write code to eliminate all __ and tada. That wouldn't work. You could use – Anonymous Pi Apr 02 '14 at 18:19

2 Answers2

1

You can't. Client apps cannot disable JavaScript in the browser.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
0

With this you can disable warning from javascript

webBrowser.ScriptErrorsSuppressed = true;
Alessio Koci
  • 1,103
  • 11
  • 24