BrowserHawk provides several properties related to the visitor's operating system details. These properties are Platform, OSDetails, OSName, OSVersion and OSArch. The following information will help you understand the differences between these properties so that you can choose the best detection technique for your particular needs.
The Platform property returns the operating system installed on a visitor's machine. Possible return values include "WinXP", "Windows Server 2003", "Windows Vista", "MacPPC", "MacOSX", and "UNIX".
The OSDetails property typically provides more general information about the OS, and typically not details information despite its property name. Possible return values include "Microsoft", "Macintosh", "SunOS", "Linux", and "SGI".
The Platform and OSDetails properties are obtained from the browser's user agent string, or in some cases inferred based on a browser type and version that may only be available on a particular platform.
The Platform and OSDetails properties are available in all editions of BrowserHawk.
OSName, like the Platform property, also returns the operating system installed on a visitor's machine. Possible return values are the same as the Platform property, and include "WinXP", "Win2000", "WinME", "Windows Server 2003", "WinCE", "Windows Vista", "MacOSX", "Linux", "SunOS", and "IRIX64".
The difference with OSName compared to Platform is that the OSName comes from the visitor's operating system itself, rather than from the user agent string. This makes for a more accurate and reliable reading in some cases, as covered in the Advantages/Disadvantages section below.
OSVersion returns the version of the installed operating system. Possible return values include "9.2.2", "10.1", "10.3.9", "10.4", "10.4.2" (in the case of a MacOS), "4.0", "4.1", "4.9", "5.0", "5.1", "5.2" and "6.0" (in the case of Windows) and other values with other operating systems.
OSArch returns a string with information about the type of hardware architecture in use. Possible return values include "x86", "x86_64", "ppc" (Mac OS X 10+), "powerpc" (Mac OS prior to X), "i386", "mips", and "sparc".
Note: The OSName, OSVersion, and OSArch properties require the Enterprise Edition of BrowserHawk.
Advantages and Disadvantages of using Platform Vs. OSName and OSVersion:
Advantages of Platform property:
The main advantage of the Platform property is that it is a basic property. Therefore testing of this property is instantaneously performed on the server since it requires no round trip like the OSName, OSVersion and OSArch properties require. See Basic Vs. Extended Properties for more information on that subject.
Another advantage of the Platform property is that it does not require Java to be installed and enabled on the client. OSName, OSVersion, and OSArch on the other hand use Java to detect the operating system details.
Disadvantages of Platform property:
One disadvantage of the Platform property is that in rare cases it may not be accurate. In rare circumstances, especially with outdated browsers, the user agent string may misreport the operating system information or omit it altogether. Since the OSName, OSVersion and OSArch come directly from the visitor's system it is not subject to these issues with the user agent string.
Perhaps the greatest disadvantage of the Platform property is that it cannot detect specific information about the Mac OS version. In many cases with modern browsers it accurately returns "MacPPC" for Mac OS prior to X, and "MacOSX" for Mac OS X and up. However if you need to know the specific version of Mac OS in use, the OSVersion property is the only way to obtain this information.
Summary:
If you just need to detect whether a user is on Windows or Macintosh, and are not concerned about what version Windows or Mac they are on, then use the Platform property instead of OSName.
If you are concerned with detecting which Windows operating system a user is using (such as Windows 95, Windows 98, Windows ME, Windows XP, Windows 2000, Windows 2003 Server, and Windows Vista), and it is acceptable for the Platform property to be occasionally returned incorrectly (primarily with older browsers), use the Platform property instead of OSName.
To detect which version of Mac OS a visitor has installed, use the OSName and OSVersion properties instead of the Platform property.
If it is of great importance to detect the operating system details as accurately as possible under as many conditions as possible use the OSName property. In the case where Java is not available on the client fall back to using the Platform property. If Java is not available the OSName, OSVersion and OSArch will be returned as "-1" or "-2" depending on a variety of conditions.
The OSDetails property dates back to very early days of BrowserHawk. Generally this property should not be used; instead use the OSName or OSName in conjunction with OSVersion.
Sample Results
The following table shows typical results returned for the properties used in detecting operating system details. This provides an idea of what type of return results you can expect in each property. However actual results will be dependant on the specific operating system and version.
Tip: Use BrowserHawk Reports to collect this data and monitor it over time to get a full sense for what all the possible values are specific to your web site's audience.
Platform OSDetails OSName OSVersion OSArch
Win95 Microsoft Win95 4.0 x86
Win98 Microsoft Win98 4.10 x86
WinME Microsoft WinME 4.90 x86
Win200 Microsoft Win2000 5.0 x86
WinXP Microsoft WinCE 5.0 build 0 x86
WinXP Microsoft WinXP 5.1 x86
Windows Server 2003 Microsoft Windows Server 2003 5.2 x86
Windows Vista Microsoft Windows Vista 6.0 x86
MacPPC Macintosh Mac OS 9.2.2 PowerPC
MacOSX Macintosh MacOSX 10.3.9 ppc
MacOSX Macintosh MacOSX 10.4 ppc
MacOSX Macintosh MacOSX 10.4.2 ppc
UNIX SunOS SunOS 5.8 sparc
UNIX Linux Linux 2.4.20-28.8smp i386
UNIX SunOS SunOS 5.8 sparc
UNIX SGI IRIX64 6.5 mips
See Also:
Additional Steps Required for Java based properties