How to disable script-blocking in a webBrowser component? RRS feed

  • Question

  • Hello,
    I'm developing an application which make use of a local HTM page in which a JavaScript is executed. The Htm page is loaded into a WebBrowser-component in Visual Studio2008, WPF.
    The script is safe because i wrote it! Everytime that the application in loaded it automatically blocks the script-execution. It's annoying! Is it possible to set somewhere that any script can be executed in that WebBrowser component?
    Thanks in advance.
    Wednesday, October 14, 2009 3:56 PM

All replies

  • Hi Giacomo,

    I perform some tests on this issue. In my test, the script in the html page is executed whether I browse the html page in IE or WPF WebBrowser control. 

    Active Scripting is set enabled in Internet Options on my machine. If I disable Active Scripting, the script is blocked. So have a try enabling Active Scripting on your machine to see if the problem can be solved.

    To do this, open IE and select menu Tools | Internet Options. In the Internet Options dialog, switch to Security tab. If the html page you'd like to browse is from Internet, select Internet zone; if the html page is from local intranet, select Local Intranet zone, then click Custom Level button. In the next comming dialog, navigate to Scripting | Active Scripting node and select Enabled option.

    Hope this helps.

    Linda Liu

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Linda Liu Wednesday, October 21, 2009 5:29 AM
    • Unmarked as answer by G i a c Friday, October 23, 2009 2:48 PM
    Tuesday, October 20, 2009 8:19 AM
  • The thing is that the script executed in the WebBrowser is a Google Earth Plugin application and I need to find out how to skip this security check since it is not user-friendly in this case. Is there any other user interface to show a webpage with scripts without controls?
    Friday, October 23, 2009 2:48 PM