javascriptinternet-explorergoogle-chrome-frame

Can I force IE users to install Google Chrome Frame Plugin


I am using google visualization for charts, which doesn't render very well in IE8, and doesn't work at all in IE6.

I added google chrome frame, and if the user installs the plug-in google visualization works flawlessly.

Is there a way that I can force IE users to install GFC? Right now it is optional. I read the documentation, and there does not seem to be a way to configure this through the GFCInstall.check() function call.

Here is my current code:

<!--[if IE]>
    <script type="text/javascript" 
     src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>

    <style>
     .chromeFrameInstallDefaultStyle {
       border: 5px solid blue;
        top:55%;
     }
    </style>



    <script>
     // The conditional ensures that this code will only execute in IE,
     // Therefore we can use the IE-specific attachEvent without worry
     window.attachEvent("onload", function() {
       CFInstall.check({
         mode: "inline" 
       });
     });
    </script>
  <![endif]-->

Solution

  • No you cannot force the user - your best options from the Google Chrome Frame FAQ:

    How do I tell if a user has Google Chrome Frame installed?

    Google Chrome Frame adds a ‘chromeframe/X.X.X.X’ token to the User-Agent header so you can check for its presence that way. If Google Chrome Frame isn’t present, you can choose to either prompt or show fallback content. See http://www.chromium.org/developers/how-tos/chrome-frame-getting-started/understanding-chrome-frame-user-agent for more information on the User-Agent header.

    We've also provided a JavaScript library you can use to test whether Google Chrome Frame is installed and if not, to prompt the user to install it. See http://www.chromium.org/developers/how-tos/chrome-frame-getting-started for more details on how to use and customize the JavaScript library.