SetExtProperties Method

 

The SetExtProperties method is used to tell BrowserHawk which tests you want it to execute when you call the GetExtPropertiesEx method. Since this method can detect dozens of advanced properties, it is important to use this feature so that you can select only the tests you are interested in. For example, if you wish to detect the user's screen size, connection speed, and installed flash version, you simply call this method passing in the appropriate parameters prior to calling GetExtPropertiesEx.

 

Syntax:

bhObject.SetExtProperties propertyListAsString [, removeFlagAsBool]

 

propertyListAsString – this string should contain a list of the names for one or more properties that you wish to test for when calling the GetExtPropertiesEx method. If you specify multiple properties they must be separated by a comma and/or a space.

 

Note: Only special keywords and properties marked as extended properties can be specified in this list, otherwise an error will be returned. Valid properties to be specified are:

ActiveXEnabled, VBScriptEnabled, VBScriptBuild, BrowserBuild, CookiesEnabled, ConnectionSpeed, JavaEnabled, JavaScriptEnabled, JavaScriptBuild, JavaVersion, JavaVendor, MSJVMBuild, Plugin_JavaVer, NetMeetingBuild, LangUser, LangSystem, TimeZoneDiff, BrowserDateTime, BrowserDateTimeMs, FontSmoothing, TextSize, Height, Width, HeightAvail, WidthAvail, ConnectionType, ColorDepth, MSXML, Referrer, Plugin_Flash, Plugin_FlashVerEx, Plugin_Director, Plugin_DirectorVerEx, Plugin_QuickTime, Plugin_QuickTimeVerEx, Plugin_Acrobat, Plugin_AcrobatVerEx, Plugin_RealPlayer, Plugin_RealPlayerBuild, Plugin_MediaPlayer, Plugin_MediaPlayerVerEx, Plugin_iPIXViewer, Plugin_SVGViewer, Plugin_CrystalReports, Plugin_ViewPoint, Plugin_Authorware, Plugin_Mapguide, and Plugin_Citrix

 

If you wish to test for a particular property that is not in this list (for example, Browser or Platform) then it is not necessary to call the GetExtPropertiesEx method before checking that properties value.

 

Keywords - In addition to the property names listed above, the following keywords may be specified:

 

removeFlagAsBool – specify True for this optional parameter to remove the properties specified in propertyListAsString from the tests performed by GetExtPropertiesEx. This is handy if you wish to first call SetExtProperties with the "all" keyword to select all tests, and then call this method again to remove particular tests.

 

After calling SetExtProperties to select the tests you want performed, call GetExtPropertiesEx to have BrowserHawk execute the tests. Then you can check the various BrowserHawk properties you asked to be tested to retrieve the results.

 

Examples:

This example checks for screen size and flash:

<%

Set bh = Server.CreateObject("cyScape.browserObj")

' Tell BH what properties we want to check

bh.SetExtProperties "screensize, plugin_flash"

' note the call to GetExtPropertiesEx before the html tag

bh.GetExtPropertiesEx 0, "BGCOLOR=#000000"

%>

<html><head><title>Screen size test page</title></head>

<body>

Your screen size is: <% =bh.width%> X <% =bh.height%>

<P>

Flash is: <% = bh.Plugin_Flash %>

</body></html>

 

This example checks all properties except for Java version and vendor:

<%

Set bh = Server.CreateObject("cyScape.browserObj")

' Tell BH what properties we want to check

bh.SetExtProperties "all"

' Now remove the properties we don't want checked.

' Note the True flag on the end – this tells BH to remove the prop

bh.SetExtProperties "javaversion, javavendor", True

' note the call to GetExtPropertiesEx before the html tag

bh.GetExtPropertiesEx 0, "BGCOLOR=#000000"

%>

<html><head><title>All except Java version/vendor</title></head>

<body>

ActiveX controls enabled? <% = bh.ActiveXEnabled %> <P>

Flash version: <% = bh.Plugin_FlashVerEx %>

</body></html>

 

This example checks for disabled JavaScript and disabled cookies.

<%

Set bh = Server.CreateObject("cyScape.browserObj")

' Tell BH what properties we want to check

bh.SetExtProperties "javascriptenabled, cookiesenabled"

' note the call to GetExtPropertiesEx before the html tag

bh.GetExtPropertiesEx 0, "BGCOLOR=#000000"

%>

<html><head><title>JS/cookies test</title></head>

<body>

JavaScript enabled? <% = bh.JavaScriptEnabled %>

<P>

Cookies enabled: <% = bh.CookiesEnabled %>

</body></html>

 

This example checks for connection speed.

<%

Set bh = Server.CreateObject("cyScape.browserObj")

' Tell BH what properties we want to check

bh.SetExtProperties "connectionspeed"

' note the call to GetExtPropertiesEx before the html tag

bh.GetExtPropertiesEx 0, "BGCOLOR=#000000"

%>

<html><head><title>Connection speed test</title></head>

<body>

Connection speed reading is: <% = bh.ConnectionSpeed %> <P>

Details: <% = bh.Translate("ConnectionSpeed") %>

</body></html>

 

See Also:

GetExtPropertiesEx Method

Property Reference Guide