disable javascript in System.Windows.Forms.WebBrowser


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
 
Ad

Advertisements

G

Guest

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

David
 
Ad

Advertisements

Joined
Jun 4, 2014
Messages
1
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top