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.
This is the extended property version of OSVersion. 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 these properties 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: Tthe 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.
Special notes for 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 null.
If the user’s JavaScript is disabled this property will not be available.
Note: Use of this property requires the Enterprise Edition of BrowserHawk.
C# Example:
<%
ExtendedOptions options = new ExtendedOptions();
options.AddProperties("OSVersion");
ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);
%>
<html>OSVersion is: <% Response.Write(extBrow.OSVersion); %>
</html>
See Also:
Detecting Operating System Details
Additional Steps Required for Java based properties (for extended property testing only)