Question

How can I detect whether Google Chrome Frame (GCF) is installed and enabled? Any javascript or css type solution is welcome. (Strict no-bloat policy against using other frameworks and downloads.)

I am building a website that uses HTML 5 features, not all of which are supported by Microsoft Internet Explorer < v10 (at least). I have a check (javascript) for MSIE 9 or earlier, but this alone would be bad if GCF is installed. If GCF is installed and enabled, the application should go on its merry way without concern for the fact that it's running in MSIE.

I've been googling and it looks like navigation.plugins() might provide a solution, but then I need more information to check specifically for GCF; so I don't yet know how to use it. As suggested above, I'm not limiting answers to navigation.plugins(). I'm just saying that's as far as I've gotten on my own; so, if you know how to reference this specific plugin, it's a possible solution.

Was it helpful?

Solution 3

I have to schedule my own tests for later, but at present; it appears I have confirmation for Waleed Khan's answer in comments below the question. The User Agent will return a string that contains the term "chromeframe." That seems to be spot on for what I need. I only need to check if the browser is MSIE < 10, and I already have a check for that. Should be fast (I presume) and seems to cover all the necessary bases.

OTHER TIPS

You should probably look at using Browser Feature Detection rather than browser sniffing. This method will allow you to determine if the browser supports the required features of your app, regardless of whether it's IE or not.

You could (or some would argue, should) take this further and simply hide the parts of your app that depend on these features, or provide suitable fallbacks, rather than completely blocking those users.

The way to see if GCF is functioning is by looking at the user agent. If you see 'chromeframe' token in it then it's installed and enabled. Now if some software disables chrome frame BHO then a following script should tell if you it is installed:

function IsGCFInstalled() {

      try {

        var i = new ActiveXObject('ChromeTab.ChromeFrame');
        if (i) {
          return true;
        }
      } catch(e) {
        log('ChromeFrame not available, error:', e.message);
        // squelch
      }

      return false;

}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top