Invoke Google Chrome Frame When Available

Google recently changed the way you harness the power of Google Chrome Frame in Internet Explorer. Chrome Frame is the plugin which adds Google Chrome as a browser renderer inside Internet Explorer, giving you access to, among other things, HTML5.

Previously, you inserted a simple meta tag. Now you have to send the headers programmatically. Fortunately, that’s not as hard as it sounds.

Paste the following PHP code somewhere in your webpage header template (if you’re using WordPress, simply paste it in your themes functions.php file).

/**
 * Invoke Google Chrome Frame
 */
if(strpos($_SERVER['HTTP_USER_AGENT'], 'chromeframe')) {
	header('X-UA-Compatible: chrome=1');
}

Now you’re done. If Chrome Frame is detected, it’s harnessed.