Google announced this week that its Chrome Frame solution for Internet Explorer would move away from meta tag invocation in favor of using an equivalent HTTP header.
Google's Chrome Frame is an open source plugin that lets Internet Explorer (IE) users enjoy a better browser experience and allows them to view pages (or experience all of the functions of pages) running HTML 5 APIs or other open web technologies that IE is not capable of supporting. In short, the Chrome Frame plug-in allows users that might be forced, for any number of reasons, to use IE to still have a modern browsing experience.
Developers can invoke Chrome Frame in the mark-up for a particular page or web application. When IE users with the Chrome Frame plugin visit that page or application, it is rendered by Chrome's V8-powered (V8 is Chrome's JavaScript interpreter) WebKit engine, and not by IE, even though IE will still be the browser.
Until this week, Chrome Frame was included via a meta tag.
<meta http-equiv="X-UA-Compatible" content="chrome=1">
But using this meta method has a few drawbacks. For one, it would not validate and, two, for some sites, the meta tag could not be placed early enough in the code to ensure that Chrome Frame would launch.
Google has now updated Chrome Frame so that it can be invoked with an HTTP header. Meta tags will still be supported so that existing instances of Chrome Frame don't break.
X-UA-Compatible: chrome=1
According to Google, this approach has several advantages.
- It will validate.
- It can be detected regardless of other HTTP headers.
- Sites will be able to use standard MIME types (including application/xhtml+xml), which IE does not support.
- Chrome Frame can be invoked at the server level.
To take advantage of server-level invocation, you'll need to use an Apache web server with mod_headers and mod_setenvif enabled. If this is how your server is configured, simply write a header directive like the one offered by Google software engineer, Alex Russell:
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch chromeframe gcf
Header append X-UA-Compatible "chrome=1" env=gcf
</IfModule>
</IfModule>
This should put Chrome Frame on every page of your website, all at once.
