简体   繁体   English

ChromeFrame忽略跨站点导航中的X-UA兼容标头

[英]ChromeFrame ignoring X-UA-Compatible header in cross-site navigation

I am attempting to migrate a suite of web applications over from .NET 2.0 WebForms to a HTML5 Backbone app fed by a WCF web service, and have hit a pretty major snag. 我试图将一组Web应用程序从.NET 2.0 WebForms迁移到WCF Web服务提供的HTML5 Backbone应用程序,但遇到了很大的麻烦。

Hosting the two sites side-by-side, with web.config for each set up with the following: 并排托管两个站点,每个站点都使用web.config进行以下设置:

New App 新应用程式

<httpProtocol>
  <customHeaders>
    <clear />
    <add name="X-UA-Compatible" value="IE=edge,chrome=1" />
  </customHeaders>
</httpProtocol>

Legacy App 旧版应用

<httpProtocol>
  <customHeaders>
    <clear />
    <add name="X-UA-Compatible" value="IE=7,9" />
  </customHeaders>
</httpProtocol>

With Chrome Frame installed, visiting each site independently seems to work fine, but linking from one to other with a hyperlink causes the header to be ignored, as far as I can tell. 安装了Chrome浏览器内嵌框架后,似乎可以独立访问每个站点了,但是据我所知,使用超链接从一个站点链接到另一个站点会使标题被忽略。 This means that old code that was targetted to IE7 (nothing to do with me!) falls over if the user has navigated to it from our HTML5 home page. 这意味着如果用户已从我们的HTML5主页导航到IE7,则旧目标代码将落入IE7(与我无关)!

Has anyone encountered this problem before, and if so, how did you get around it? 有人遇到过这个问题吗?如果是,您是如何解决这个问题的?


< < antisnark> 抗蛇药>

Let's assume that porting all the legacy code over before launch is out of the question. 让我们假设在启动之前移植所有遗留代码是不可能的。

< < /antisnark> / antisnark>

Chrome Frame has been discontinued. Chrome内嵌框架已停产。

Your best bet is to switch to Chrome's Legacy Browser Support , which silently switches the user's browser depending on the site being visited. 最好的选择是切换到Chrome的旧版浏览器支持 ,它会根据所访问的站点以静默方式切换用户的浏览器。

Edit 编辑

From the documentation 文档中

Chrome Frame as a closed container Chrome框架作为密闭容器

GCF sends all top level navigation to Internet Explorer. GCF将所有顶级导航发送到Internet Explorer。 This is to allow content to load other links in the host browser. 这是为了允许内容加载主机浏览器中的其他链接。 This feature can be turned off by adding a DWORD value HandleTopLevelRequests=0 under HKCU\\Software\\Google\\ChromeFrame. 可以通过在HKCU \\ Software \\ Google \\ ChromeFrame下添加DWORD值HandleTopLevelRequests = 0来关闭此功能。 In this case all the subsequent top level navigations will remain inside Chrome Frame whether they have a meta tag or not. 在这种情况下,所有后续的顶级导航都将保留在Chrome框架内,无论它们是否具有meta标签。

So to break out of CF, you must either set target="_top" on the link or open the link with a popup window--this as long as the registry key HandleTopLevelRequests is set to 1. 因此,要打破CF,您必须在链接上设置target="_top"或使用弹出窗口打开链接-只要注册表项HandleTopLevelRequests设置为1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM