0

I have the following code to detect to see if CF BHO is enabled, but unfortunately it didn't work out, it alway returns "automation server failed to create obj"

  var activexGoogleFrameBho = new ActiveXObject('ChromeFrame.Bho');
  if (activexGoogleFrameBho) {
    ...
  }

My user agent and page header are as following:

  mozilla/4.0(compatible; msie 8.0; windows nt 6.1; wow64; trident/4.0;
  chromeframe/32.0.1700.107; slcc2; .net clr 2.0.50727; .net4.0c; .net4.0e)

  <meta http-equiv='X-UA-Compatible' content='IE=Edge,chrome=IE8'/>

any ideas?

Thanks,

Lys
  • 591
  • 2
  • 9
  • 19

1 Answers1

1

I'm not sure if you can detect the helper object itself though to see if the current page is loaded in chromeframe you can check if window.externalHost exists.

http://www.chromium.org/developers/how-tos/chrome-frame-getting-started/understanding-chrome-frame-user-agent#TOC-From-the-script-on-the-web-page

Karl-Johan Sjögren
  • 16,544
  • 7
  • 59
  • 68
  • Thanks for reply. I tried this in IE7 but the variable always returns 'undefined'. Is this only applies to Chrome not other browsers? It seems this is what indicated in the above link. – Lys Feb 17 '14 at 07:51
  • The link is about the Chrome Frame-plugin and how to detect it. I'm no expert on it though but I've used the above solutions myself before and it worked fine (ie `if(window.externalHost) {alert('In a Chrome Frame!'; }`). – Karl-Johan Sjögren Feb 17 '14 at 08:58