The Navigator Object
The Window.navigator
property refers to a
Navigator object that contains
information about the web browser as a whole, such as the version and
a list of the data formats it can display. The Navigator object is
named after Netscape Navigator, but it is also supported by
Internet Explorer. IE also
supports
clientInformation
as a vendor-neutral synonym for
navigator
. Unfortunately, Netscape and Mozilla do
not support this property.
The Navigator object has five main properties that provide version information about the browser that is running:
-
appName
The simple name of the web browser.
-
appVersion
The version number and/or other version information for the browser. Note that this should be considered an “internal” version number, since it does not always correspond to the version number displayed to the user. For example, Netscape 6 reports a version number of 5.0, since there never was a Netscape 5 release. Also, IE Versions 4 through 6 all report a version number of 4.0, to indicate compatibility with the baseline functionality of fourth-generation browsers.
-
userAgent
The string that the browser sends in its
USER-AGENT
HTTP header. This property typically contains all the information in bothappName
andappVersion
.-
appCodeName
The code name of the browser. Netscape uses the code name “Mozilla” as the value of this property. For compatibility, IE does the same thing.
-
platform
The hardware platform on which the browser is running. This property was ...
Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.