Type: String
OSVersion returns the version number, as a string, of the user's operating system. Examples of the OSVersion string for OS X users include "10.6.8" and "10.7.2". Note that Windows also has version numbers which represent the OS type, such as XP, Vista or Windows 8.
Tip: See Detecting Operating System Details for examples of the possible values returned by this property.
In general, we recommend only obtaining the OSVersion property using the basic version (not performing an extended property test for this property). The basic property check is instantaneous, whereas the extended property check requires BrowserHawk to use Java to perform this test which is much slower in comparison. There are two cases, however, where using the extended property version of OSVersion has an advantage when it comes to testing OS X users: 1) With Firefox on OS X the basic version of OSVersion will only return the version in x.y format, such as "10.7" and not "10.7.2", and 2) With Opera version 10 and earlier on OS X, no OSVersion information is available with the basic property version. If these cases are very important to you, use the extended property version. Otherwise the basic version will provide the same results, but much faster.
Note: If using the extended property version, you must call the GetExtPropertiesEx method before checking the value of this property. This property requires the Enterprise Edition of BrowserHawk.
Note: The OSVersion property is returned as a string. For numeric comparisons, such as checking to see if a version is greater than a certain version, you may find BrowserHawk's CompareVersion helper function useful.
Example of basic property usage (recommended):
<% set bhObj = Server.CreateObject("cyScape.browserObj")
response.write "Your OS version is: " & bhObj.OSVersion
%>
Example of extended property usage:
<% set bhObj = Server.CreateObject("cyScape.browserObj")
bhObj.SetExtProperties "OSVersion"
bhObj.GetExtPropertiesEx
response.write "Your OS version is: " & bhObj.OSVersion
%>
Special notes for this property - applies only if using the extended property version of OSVersion (does not apply to basic version of this property):
The visitor's browser must have Java installed and enabled to use this property. In the event they do not, a string value of "-1" or "-2" is returned, depending on various factors.
For browsers other than Internet Explorer on Windows, a string value of "-3" is returned to indicated that no Java plug-in is installed, which is required to detect this property.
See Detecting Operating System Details for more information about using this property and examples of return values for specific operating systems.
This property is not available on Firefox or Mozilla versions prior to 1.0, Safari versions prior to 1.2, Internet Explorer on Macintosh, Netscape versions prior to 4.0, or Opera versions prior to 7.0. In these cases this property will return an empty string.
If the user’s JavaScript is disabled this property will not be available.
See Also:
Detecting Operating System Details
Additional Steps Required for Java based properties (for extended property testing only)