disable javascript in System.Windows.Forms.WebBrowser

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to disable javascript using a
System.Windows.Forms.WebBrowser?

Specifically, when I "Navigate" to a webpage, I don't want the browser
control to run the java script contained in that webpage, which in my case
loads another webpage. I want the content of the original webpage to be in
"DocumentText."

Thanks,
David
 
I can do this using "System.Net.WebRequest" rather than
"System.Windows.Forms.WebBrowser"

David
 
On a windows machine, in control panel -> Internet Options there is a setting that I believe controls this. I can't get mine to run javascript in spite of this setting but if you're trying to turn off javascript for these embedded controls, try this.

Under Security Tab, Internet zone, click "custom level..." button, in this long list of options, look for the Miscellaneous section and find one that says "Allow scripting of Microsoft web browser control". Try disabling that one and see if that does it.
 
Back
Top