How could I disable javascript entirely on WebBrowser in WinForms?
Asked
Active
Viewed 1.0k times
8
-
1possible 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 Answers
1
You can't. Client apps cannot disable JavaScript in the browser.

Diodeus - James MacFarlane
- 112,730
- 33
- 157
- 176
-
do I have any alternatives in order to prevent pages from opening pop-ups? – bevacqua May 16 '12 at 17:43
-
If you're writing the code, wouldn't you have control over this? – Diodeus - James MacFarlane May 16 '12 at 17:45
-
-
3Incorrect. You can control the features of the Web Browser control using an IInternetSecurityManager and/or the ambient flags. – EricLaw Sep 05 '13 at 23:10
0
With this you can disable warning from javascript
webBrowser.ScriptErrorsSuppressed = true;

Alessio Koci
- 1,103
- 11
- 24