Type: String
OSName returns the general name of the user's operating system, such as "Windows", "OS X", and "Linux". For example, the OSName property is set to "Windows" for all users on Windows XP, Windows Vista, Windows 8 and so forth, and the OSName property is set to "OS X" for all Mac users on OS X. Therefore this property makes it easy to determine if a user is on Windows, OS X, Linux and other operating systems without regards the version of the OS.
Starting with BrowserHawk 14, the OSName property can be checked as a basic property, so an extended property test is no longer required. If you previously used this property as an extended property, simply remove "OSName" from the list of properties specified in your call to SetExtProperties. There is no advantage to testing OSName as an extended property for users on Windows and OS X. For users on other operating systems, such as Linux, some additional details may be provided through the extended property version. Unless that is highly desirable, the basic property version of OSName will provide for much faster testing by BrowserHawk.
Tip: See Detecting Operating System Details for examples of the possible values returned by this property.
Example of basic property usage (recommended):
<% set bhObj = Server.CreateObject("cyScape.browserObj")
response.write "Your OS name is: " & bhObj.OSName
%>
Example of extended property usage:
<% set bhObj = Server.CreateObject("cyScape.browserObj")
bhObj.SetExtProperties "OSName"
bhObj.GetExtPropertiesEx
response.write "Your OS name is: " & bhObj.OSName
%>
Note: You must call the GetExtPropertiesEx method before checking the value of this property if you use the extended property form. This property requires the Enterprise Edition of BrowserHawk.
Special notes for this property - applies only if using the extended property version of this property (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.
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)