“为帮助保护您的安全,您的网络浏览器..."的官方解决方案是什么?酒吧? [英] What is the official solution to the "To help protect your security, your web browser ..." bar?

查看:166
本文介绍了“为帮助保护您的安全,您的网络浏览器..."的官方解决方案是什么?酒吧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在.NET 3.5 WPF应用程序上使用WebBrowser控件.

I tried to use the WebBrowser control on my .NET 3.5 WPF application.

我的应用程序加载XML,然后使用XSLT将其转换为HTML,然后将HTML加载到WebBrowser中.转换后的HTML包含简单的JavaScript,可动态更改某些元素的样式. JavaScript不会带来任何风险 对系统进行操作,并且没有ActiveX控件.

My application loads an XML and then transforms it into an HTML using XSLT and loads the HTML into the WebBrowser. The transformed HTML contains simple JavaScript to change the style of some elements dynamically. The JavaScript does NOT perform any risky operation to the system and there is no ActiveX control.

 

问题是,您可能知道,WebBrowser控件为每个页面显示黄色警告栏,而不仅仅是一次.我以完全信任"和管理员"身份运行我的应用程序,但仍然必须每次都确认警告.这个 似乎很荒谬.当我使用独立的Internet Explorer或Windows Form的WebBrowser打开相同的HTML时,没有出现该栏.也就是说,此警告栏仅与WPF的WebBrowser一起出现.

The problem is, as you probably know, the WebBrowser control shows the yellow warning bar for every single page, not only once. I am running my application as Full Trust and as Administrator, but still I have to confirm the warning every single time. This seems to be ridiculous. When I open the same HTML with the stand-alone Internet Explorer or the Windows Form's WebBrowser the bar did NOT appear. That is, this warning bar only appears with WPF's WebBrowser.

 

当然,我试图在询问之前搜索Google.有一些建议的解决方案,例如Web Mark Of Trust和使用URL,例如file://127.0.0.1/C$/.他们都没有工作,我浪费了几个小时.还有其他人的问题 也认为那些没用.也许解决方案不再起作用了?

Of course, I tried to search Google before asking. There were some suggested solutions such as Web Mark Of Trust and using URL's like file://127.0.0.1/C$/. None of them worked and I wasted a few hours doing that. There were questions from other guys who also think those did not work. Maybe the solutions do not work any more?

 

由于在该论坛上我曾经收到Microsoft开发人员(或产品经理)对其他问题的答复,因此,如果可能的话,我想听听有关此问题的官方解决方案.我目前以以下方式切换到WindowsFormsHost/Form的WebBrowser: 解决方法.

Since I once got a reply from a Microsoft developer (or a product manager) for other questions in this forum, I would like to hear about the official solution to this problem, if possible. I currently switched to the WindowsFormsHost/Form's WebBrowser as a workaround.

 

推荐答案

嗯...不是官方的MS答案...而是...

Well... not an official MS answer... but...

真正奇怪的是,您说您没有在独立的浏览器中收到错误.您应该在所有IE浏览器的托管控件和独立浏览器中都使用它.当您直接从您的HTML文件中读取HTML文件时,就会发生这种情况 硬盘驱动器,而不是通过Web服务器.您应该可以通过关闭该安全功能将其关闭,但我不建议这样做.

What's really odd is that you say you don't get the error in a stand alone browser.  You should get it in all IE browsers both the hosted controls and the stand alone browser.  It occurs when when you are reading an html file directly from your hard drive instead of from a web server.  You should be able to turn it off by turning off that security feature, but I don't recommend that.

通常的解决方案是将文件放置到Web服务器上.

The normal solution is to put the file onto a web server.

但是,这会给您带来错误吗?

However, does this give you the error?

string document_text = @"<html><body><h1>Test Page</h1><script type=""text/javascript"">document.write(""<p>"" + Date() + ""</p>"");</script></body></html>";
web.NavigateToString(document_text);

在我的系统上没有错误. (Win XP)但是,如果我将完全相同的html放入文件并尝试从硬盘驱动器使用IE打开该文件,则会引发错误.

That works without error on my system. (Win XP)  It does however throw the error if I put the exact same html into a file and try and open that file with IE from my hard drive.

修改: 我几乎100%可以肯定官方的回应是这种行为是设计使然.

  I'm pretty much 100% certain that the the official response is that this behavior is by design.


这篇关于“为帮助保护您的安全,您的网络浏览器..."的官方解决方案是什么?酒吧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆