The window.navigator object is used to obtain visitor’s browser object information such as if cookie’s are enabled, browser name, browser engine, version …etc. It can be also used without the window prefix.

Syntax for the navigator object




The following properties are defined in the navigator object:

  • navigator.cookieEnabled –  Returns true if cookies of the browser are enabled, else returns false.
  • navigator.appName and navigator.appCodeName – Returns name of the browser; IE11, Chrome, Firefox, Safari gives appName as “Netscape”, while Chrome, Firefox, IE, Safari and Opera gives appCodeName as “Mozilla”.
  • navigator.product – Returns engine name of the browser.
  • navigator.appVersion and navigator.userAgent – Returns version information of the browser. (However this property can be misleading because different browsers can use same name. Navigator data can be changed or misidentified. New OS released after the browser is installed cannot be recognized by browser.)
  • navigator.platform – Returns OS where browser is installed.
  • navigator.language – Returns browser’s language.
  • navigator.javaEnabled() – Returns true if Java is enabled.

Example with the navigator object's properties


›› go to examples ››