Type: String
ContainerBrowser returns the name of the actual browser in which an embedded IE engine is contained within. When Netscape is used in IE emulation mode, this property returns "Netscape". For the AOL Explorer browser, it returns "AOL Explorer". For content viewed via Windows Media Player, it returns "Windows Media Player". For browsers not running IE emulation this property will be equal to an empty string.
Tip: See Detecting Browsers That Emulate Internet Explorer for important additional information on browsers that embed IE.
Example 1:
This example demonstrates how to determine if a browser is really IE or if it is a non-IE browser running with IE emulation through an embedded IE engine. The results of the test are then displayed:
<% set bhObj = Server.CreateObject("cyScape.browserObj") %>
<html>
<%
if bhObj.Browser = "IE" AND bhObj.ContainerBrowser <> "" then
'This is a browser emulating IE
Response.Write "Your are running a browser that is emulating IE version " & bhObj.Fullversion & "<br>"
Response.Write "Your browser really is " & bhObj.ContainerBrowser & " " & bhObj.ContainerFullversion
else
Response.Write "Your browser is " & bhObj.Browser & " version " & bhObj.Fullversion
end if
%>
</html>
Example 2:
This example demonstrates how to determine if a browser is really IE or if it is a non-IE browser running with IE emulation through an embedded IE engine. If the browser is using IE emulation the visitor is redirected to an alternative page.
<% set bhObj = Server.CreateObject("cyScape.browserObj")
if bhObj.Browser = "IE" AND bhObj.ContainerBrowser <> "" then
'This is a browser emulating IE
response.redirect "http://www.yahoo.com" 'obviously you would redir to a page on your site
end if
%>
<html> Page for real IE and any browsers not emulating IE goes here </html>
See Also: