Modern Software Experience

2009-09-29

Chrome Frame

The Chrome Frame plug-in upgrades Intranet Explorer to Internet Explorer.

Internet Explorer

The Chrome Frame plug-in upgrades Intranet Explorer to Internet Explorer. It does so by slipping a standards-compliance rendering engine into Internet Explorer, the one thing it infamously lacks.

Trident, Internet Explorer’s own rendering engine has, to put it mildly, rather limited support for the web. WebKit, the rendering engine used by Apple Safari and Google Chrome, is designed to support the web.

With Chrome Frame installed, Internet Explorer users can fully enjoy web; Chrome Frame enables Internet Explorer to display sites as they were meant to be displayed, Chrome Frame even renders sites that Internet Explorer did not render at all.

do nothing default

Chrome Frame is a Good Thing, arguably the best thing to ever happen to to Internet Explorer users. However, Chrome Frame defaults to doing nothing. Even if a visitor has Chrome Frame installed, your web site will still not automatically look as good as it does in Google Chrome. Only if your site indicates that it wants Chrome will Chrome Frame take over from Internet Explorer.

enabling Chrome Frame

To have your web pages rendered by Chrome Frame’s WebKit instead of Trident, you need to add a meta-tag. The Chromium blog post that introduced Chrome Frame already specifies this meta-tag:

<meta http-equiv="X-UA-Compatible" content="chrome=1">

The sharp reader will notice that this meta-tag is not valid. The meta-tag is opened, but not closed. That is a rather embarrassing faux pas in a blog post that espouses the virtues of a standards-based rendering engine. What you actually should include is this:

<meta http-equiv="X-UA-Compatible" content="chrome=1" />

XHTML

Chrome Frame should take over from Trident when this meta-tag is present, but it fails to do so when it is included in XHTML pages, and the meta-tag code provided by the Chrome Frame team is invalid. Those two facts are strong indicators that the development team was so focussed on HTML5 support, that they forgot to test Chrome Frame with XHTML pages.

That is a bit odd, considering that Chrome Frame’s frame support for this major web standard fixes what’s arguably Internet Explorer’s biggest shortcoming. I reckon this Chrome Frame defect will be fixed in an updated version soon. So, although does this meta-tag does not trigger Chrome Frame today, you should expect it to trigger Chrome Frame soon.

meta-tag objections

I happen to think that meta-tags that tell browsers to switch to Standards Mode are wrong, for one simple reason: a browser should default to Standards Mode. Switching to something other than Standards Mode should require marking your page as non-standard. The onus should be on those who disrespect from standards, not on those who respect standards.

Although you can think of switching to Chrome Frame as switching to a real Standards Mode that Internet Explorer did not have before, that is not really what the Chrome meta-tags tells the browser to do. The Chrome meta-tag does not tell the browser to switch to any particular rendering mode at all, it tells the browser to switch to another rendering engine.

all pages

To make sure your visitor has the full benefit of Chrome Frame, you need to add the Chrome meta-tag to every page; pages you do not add the Chrome meta-tag to will default to Trident rendering.

tip

The Chrome Frame plug-in looks for the Chrome meta-tag in the page header, but it only scans the first kilobyte, and will not recognise the meta-tag if it is further down. Make sure you place the Chrome meta-tag early in in the page header.

updating

Updating all pages is relatively easy to do by either updating your page templates and thus all your pages, or by performing a search/replace on all files. I do recommend to do so after making a backup and to test the resulting site before uploading it.

Many web site tools are likely to add the Chrome tag to their default page templates soon, and to provide the user with an option to update existing page templates. However, web developers using Microsoft’s Expression Web should not probably hold their breath.

harmless

The Chrome meta-tag seems harmless. The Chrome meta-tag does not harm the web by promoting support for any particular version of any browser engine. The Chrome meta-tag does not affect the behaviour of Internet Explorer when Chrome Frame is absent; Internet Explorer does not understand the Chrome meta-tag, only Chrome Frame understands it.

user control

My one objection against the Chrome meta-tag is that the current release of Chrome Frame does not keep the user in control; if some web developer adds the Chrome meta-tag to a page that uses ActiveX controls, there is no menu that lets the user override the meta-tag and switch back to Internet Explorer rendering.

make sure

I recommend that you make sure that your pages work fine, by testing in Google Chrome before adding the Chrome meta-tag. Of course, you should make sure that your site works in all four major web browsers anyway; Opera, Firefox, Apple Safari and Google Chrome. If you develop your site to web standards, it should display just fine in all of them already.

differences

Now, there probably should not be any differences between Google Chrome and Chrome Frame, but when I tried the Acid3 test, the results for Internet Explorer, Chrome Frame and Google Chrome were all different; 20%, 95% and 100% respectively. Somehow, Chrome Frame does produce exactly the same results as Google Chrome.

So, even when your site looks fine in Google Chrome, you may still want to make sure it looks fine Chrome Frame by testing using the cf: prefix before adding the Chrome meta-tag, or by reviewing the updated pages in Internet Explorer with Chrome Frame before uploading the updated pages to your web site.

I do expect the Chrome Frame team to figure out why Chrome Frame and Google Chrome do not produce exactly the same results and to fix those issues, so that you can be sure that Chrome Frame will render your site exactly like Google Chrome like, and testing in Google Chrome is good enough.

detecting Chrome Frame

You want your web site to look as good as possible, so if your web site looks better in Chrome than it does in Internet Explorer, you should not only add the Chrome meta-tag to your pages, but also encourage Internet Explorer users to install the Chrome Frame plug-in.

Google does not provide any buttons to promote Chrome Frame with, but Google does offer two ways to detect Chrome Frame, including a script that will only offer to install Google Chrome if it is not installed yet.

links