简体   繁体   中英

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.

Hosting the two sites side-by-side, with web.config for each set up with the following:

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. 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.

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>

Chrome Frame has been discontinued.

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.

Edit

From the documentation

Chrome Frame as a closed container

GCF sends all top level navigation to 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. In this case all the subsequent top level navigations will remain inside Chrome Frame whether they have a meta tag or not.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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