1

I have a problem with a webBrowser. I follow the instruction here C# webbrowser Ajax call to customize the webBrowser but I have a problem with security, I think. When my application starts, I have this message in my webbrowser:

To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Click here for options

How can I force the webBrowser to accept my script?

Community
  • 1
  • 1
salvo italy
  • 193
  • 2
  • 4
  • 13
  • sounds like you're trying to access the file from file path rather than a web server path (e.g. `C:\path\to\file` instead of `http://localhost/`). Setup a web server that can serve the file over HTTP. – Kevin Nelson Feb 24 '15 at 19:52
  • Yes, I load my locale web page in webBrowser. How can I fix? – salvo italy Feb 24 '15 at 19:54
  • both options I gave are loading local web page in browser. One is doing it through the file system, the other is doing it through a web server. Which are you doing? Is your path like `http://localhost`? If not, I already gave the answer: "Setup a web server that can serve the file over HTTP"--install IIS, point it to your path, etc. If you use Visual Studio, you can just run your site, and it should setup a temp server for you on some port. – Kevin Nelson Feb 24 '15 at 20:00
  • I doing it through file system: I have my site under an HTML folder And load it in my webBrowser. – salvo italy Feb 24 '15 at 21:02
  • So, then, yes, you need to install IIS or use something like Visual Studio's built-in web server that's used when you hit 'Run' – Kevin Nelson Feb 24 '15 at 21:17
  • 1
    Try disabling `FEATURE_LOCALMACHINE_LOCKDOWN` and `FEATURE_BLOCK_LMZ_SCRIPT` (but think twice). More details: http://blogs.msdn.com/b/ieinternals/archive/2011/03/23/understanding-local-machine-zone-lockdown-restricted-this-webpage-from-running-scripts-or-activex-controls.aspx. The author @EricLaw might have a better suggestion. – noseratio Feb 24 '15 at 23:43
  • @Noseratio I write `FEATURE_LOCALMACHINE_LOCKDOWN` and the other but nothing is changed. When page is loaded, the alert will prompt. I use also `` : it doesn't show the security warning but makes error in my script that, now, dowsn't work. I very frustated. – salvo italy Feb 25 '15 at 09:14
  • You're setting `FEATURE_LOCALMACHINE_LOCKDOWN` to `0`, right? Anyhow, this works for me with IE11. I didn't try any earlier versions. – noseratio Feb 25 '15 at 10:18
  • Yes, my FEATURE_BROWSER_EMULATION is set to 11 but, when the webApp starts, nothing change. – salvo italy Feb 25 '15 at 10:24
  • Maybe I resolved add `` IN ALL PAGES I use. Before I put it only on the first page. – salvo italy Feb 25 '15 at 10:53

0 Answers0