Detect Internet Explorer and Google Chrome Frame with JavaScript

To make the Internet Explorer HTML5-competitive it is advisable to install Google Chrome Frame. JavaScript allows to discover whether Google Chrome Frame is already installed.

if(navigator.appName == 'Microsoft Internet Explorer'){
  var hasChromeFrame = navigator.userAgent.match(/(chromeframe)/);
  if(hasChromeFrame == null){
    window.location = '';

Another option is to use some Google stuff. But then the dialog to install Chrome Frame (CF) is only shown once per session:

<!--[if IE]>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
  // Check if Chrome Frame is installed and display an overlay if not
    mode: "overlay"