Changing “active content” security settings on WPF WebBrowser control

穿精又带淫゛_ 提交于 2019-11-30 06:26:36
Jonathan Schuster

We eventually found a decent solution to this, although I still wish there were some sort of settings on the control itself. To load the documents, we just set browser.Source to be the following:

file://127.0.0.1/c$/path/to/the/file (where the path is an absolute path without C:\, for example, c$/Users/jschuster/mydocument.html)

For whatever reason, the control will display files referenced by a URL in that format without a warning.

Hope this might help someone even that the question is a bit old ...

As per the link to "The Mark Of The Web" , adding comment like

<!-- saved from url=(0016)http://localhost -->

just under the HTML tag worked.

My index.html is in HTML folder, added as "content" set to "Always copy" in WPF project using WebBrowser control. The address to the file during execution look like this:

file:///E:/SRC_2013/WebBrowserTestApp/WebBrowserTestApp/bin/Debug/HTML/index.html

Why not insert the MOTW dynamically at the beginning of the file when you load it ?

By the way, thanks for your question : I didn't know about the "mark of the web" and it solved a problem I had :)

file://127.0.0.1/c$/path/to/the/file (where the path is an absolute path without C:\, for example, c$/Users/jschuster/mydocument.html)

This worked for me as well on Win7.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!