Detecting Browsers That Emulate Internet Explorer

What is embedded Internet Explorer?

There are now browsers now in the marketplace that embed the Internet Explorer rendering engine in the browser to essentially emulate IE. Specifically, Netscape 8.0 and higher, and the AOL Explorer browser provide this functionality.

Netscape 8.0 and higher

Netscape 8.0 and higher has two different modes of operation in this regard. In the default mode, Netscape uses the IE rendering engine to simulate an IE browser. In this mode Netscape processes all HTML, JavaScript, ActiveX controls and all other such content it receives very similar to how IE would process this information. This is because "under the hood" it is indeed the IE engine that is processing the page.

Netscape 8.0 and higher also has a "View as Firefox" mode. In this mode, Netscape uses the Firefox rendering engine and processes the page natively as a Netscape browser. In this mode any IE specific content will cause errors in the browser. Netscape users can easily switch between these two modes of operation, and can even set preferences to view certain web sites using the IE rendering engine and others using the native Netscape engine (as Firefox).

AOL Explorer

Similar to Netscape 8.0 and above, AOL Explorer also embeds the Internet Explorer rendering engine. However, unlike Netscape's ability to switch between a native Vs. IE mode, AOL Explorer has no rendering engine of its own. Instead it always uses the embedded IE engine to process and render pages.

 

Windows Media Player

Windows Media Player can be used as a browser to surf pages within the media player itself. In this case the IE rendering engine is used. Users will not typically be browsing your site with Windows Media Player unless you specifically set up a resource file for them to access to do so. In other words, this is not something you typically need to be concerned with unless you are specifically directing traffic to your site within the Windows Media Player. In that case you will want to know when visitors are coming in via a browser Vs. the media player since the controls and screen layout is so different.

 

Note: In the event you need to specifically test for Windows Media Player as a possible containing "browser" for an embedded IE engine, you must perform an extended property check and specify "ContainerBrowser" as the property to be check. This step is not necessary to detect when the containing browser is Netscape or AOL Explorer. In addition it is not recommended you perform an extended property check for "ContainerBrowser" unless you specifically want to check for Windows Media Player as the containing browser.

The Advantage to Embedded Internet Explorer

By embedded the IE engine into browsers, browser manufacturers are trying to provide better compatibility between their browser and web pages written specifically for IE. For example, suppose Netscape was your favorite browser, but your banking site uses ActiveX controls and other page content that is very specific to IE.

 

Without the embedded IE option in Netscape 8 and higher, you simply could not use your Netscape browser to access the site. With this option, however, you now may be able to access the IE specific content with your Netscape browser.

 

In the case of AOL Explorer, embedding the IE rendering engines enables AOL to leverage the IE code base to quickly develop its own "IE-like" browser, but with unique features and options of its own.

The Challenge for developers caused by embedded IE engines

The "embedded IE" concept seems like a win-win for all parties, and in some cases it can be a helpful and valuable feature. However, a browser which embeds IE is still not IE. There are indeed differences between a real IE browser and an embedded IE browser, and these differences sometimes result in unexpected broken functionality or presentation in web pages.

 

For instance, as a developer you may find that your web pages do not work properly when viewed with Netscape in IE mode or in AOL Explorer. In that case you will want to take action to dynamically change the content sent to a browser that is emulating IE to work around the issue.

 

In another scenario you may have a requirement that only certain browsers are allowed to access the site (out of security or other concerns). In this case you would want to alert the user that their browser is not supported and to explain what the recommended course of action is.

How BrowserHawk handles embedded IE browsers

BrowserHawk makes it very easy for you to detect the difference between a real IE browser and a non-IE browser that is using an embedded IE engine to simulate IE. This is important for the reasons covered above.

 

The natural way of thinking is that BrowserHawk would just return the real browser name in the Browser property. For example, if it was Netscape using the embedded IE engine, then BrowserHawk would return "Netscape" for the browser property rather than "IE".

 

However this is not the way it works, because using that approach would result in you sending Netscape specific content to an IE rendering engine. That in turn would result in a broken page - certainly not what you intended.

 

With this in mind, BrowserHawk returns "IE" for the browser property when it detects that a browser is running with the embedded IE rendering engine. This means that any Netscape browser running in IE emulation mode, and all AOL Explorer users, will have the browser type and version properties set according to the IE rendering engine in use and not the "containing" or wrapping browser itself (Netscape or AOL Explorer in this case).

 

This results in your pages sending the proper content by default to the widest possible audience. For example, take a look at the pseudo-code below:

 If Browser = "IE" then

  serve this IE specific content

 else if Browser = "Netscape" or "Firefox" or "Mozilla" then

  serve this content

 else

  redirect to another page

 end if

 

Using this pseudo-code as a model, your IE specific content is served to both real IE users, as well as those using a non-IE browser running with the IE rendering engine. Provided you have no issues with your IE content running on browsers that embed IE, this approach results in you serving your content to the widest possible audience.

 

However, what if you do have problems with your IE content running on embedded IE browsers? Or what if your business rules state that embedded IE users should not be allowed to access portions of your site? In these cases you will most certainly want to detect the difference between a real IE browser and an embedded one. This is where the ContainerBrowser, ContainerVersion, and ContainerFullversion properties come in.

Understanding the ContainerBrowser, ContainerVersion, and ContainerFullversion properties

The ContainerBrowser, ContainerVersion, and ContainerFullversion properties are used to provide details about the "container" browser (the browser that "contains" the embedded IE engine).

 

The ContainerBrowser property is set to the name of the actual browser in which the embedded IE engine is contained within. When Netscape is used in IE emulation mode, this property is set to "Netscape". When AOL Explorer is used, it is set to "AOL Explorer".

 

The ContainerVersion property is a numeric property that is set to the major and minor version number of the containing browser. For instance with Netscape 8.0.3 running in IE emulation mode this property is set to 8.0. For AOL Explorer 1.1 it is set to 1.1.

 

The ContainerFullversion property is similar to ContainerVersion, except that it captures full version information which cannot be represented by a numeric property. For instance with Netscape 8.0.3 running in IE emulation mode this property is set to "8.0.3". For AOL Explorer 1.1 it is set to "1.1".

 

The following listing summarizes the various browser type and versions for a variety of scenarios:

 

Browser used: IE 7.0 (not emulated, real IE)

 Browser: "IE"

 Version: 7.0

 Fullversion: "7.0"

 ContainerBrowser: ""

 ContainerVersion: 0

 ContainerFullversion: ""

 

Browser used: Netscape 8.0.3 in IE emulation mode with IE 6.0 installed

 Browser: "IE"

 Version: 6.0

 Fullversion: "6.0"

 ContainerBrowser: "Netscape"

 ContainerVersion: 8.0

 ContainerFullversion: "8.0.3"

 

Browser used: Netscape 8.0.3 in IE emulation mode with IE 7.0 installed

 Browser: "IE"

 Version: 7.0

 Fullversion: "7.0"

 ContainerBrowser: "Netscape"

 ContainerVersion: 8.0

 ContainerFullversion: "8.0.3"

 

Browser used: Netscape 8.0.3 not in IE emulation mode

 Browser: "Netscape"

 Version: 8.0

 Fullversion: "8.0.3"

 ContainerBrowser: ""

 ContainerVersion: 0

 ContainerFullversion: ""

 

Browser used: AOL Explorer 1.1 with IE 6.0 installed

 Browser: "IE"

 Version: 6.0

 Fullversion: "6.0"

 ContainerBrowser: "AOL Explorer"

 ContainerVersion: 1.1

 ContainerFullversion: "1.1"

 

Browser used: Firefox 2.0.1

 Browser: "Firefox"

 Version: 2.0

 Fullversion: "2.0.1"

 ContainerBrowser: ""

 ContainerVersion: 0

 ContainerFullversion: ""

 

Browser used: Windows Media Player 10.0.5100.0 with IE 6.0 installed

 Browser: "IE"

 Version: 6.0

 Fullversion: 

 ContainerBrowser: "Windows Media Player"

 ContainerVersion: 10.0

 ContainerFullversion: "10.0.5100.0"

 

See Also:

ContainerBrowser Property

ContainerVersion Property

ContainerFullversion Property

ContainerBrowser Property (.NET)

ContainerVersion Property (.NET)

ContainerFullversion Property (.NET)