Type: String
OSName returns the operating system installed on a visitor's machine. Possible return values include "WinXP", "Win2000", "Windows Server 2003", "WinME", "WinCE", "Windows Vista", "MacOSX", "Linux", "SunOS", and "IRIX64".
Note: You must call the GetExtPropertiesEx method before checking the value of this property. This property requires the Enterprise Edition of BrowserHawk.
Example:
<% set bhObj = Server.CreateObject("cyScape.browserObj")
bhObj.SetExtProperties "OSName"
bhObj.GetExtPropertiesEx
%>
<html>OSName is:
<%
if bhObj.OSName = -1 OR bhObj.OSName = -2 then
'Fall back to use the Platform property
PropVal = bhObj.Platform
else
Propval = bhObj.OSName
end if
response.write PropVal
%>
</html>
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.
In general, the OSName property can provide slightly greater accuracy over the Platform property, particularly with outdated browsers. However the Platform property is a faster test and generally recommended over OSName. See Detecting Operating System Details for more information on the advantages and disadvantages of using the OSName Vs. Platform property to help you determine which is most appropriate for your needs.
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:
Additional Steps Required for Java based properties