Navigator
The window.navigator object contains information about the visitor's platform(browser).
Window Navigator
The window.navigator
object can be written without the window prefix like this.
Some examples:
navigator.appName
navigator.appCodeName
navigator.platform
Browser Cookies
The cookieEnabled
property returns true if cookies are enabled, otherwise false:
Example
Browser Application Name
The appName
property returns the application name of the browser:
Example
Strange enough, "Netscape" is the application name for both IE11, Chrome, Firefox, and Safari.
Browser Application Code Name
The appCodeName
property returns the application code name of the browser:
Example
"Mozilla" is the application code name for both Chrome, Firefox, IE, Safari, and Opera.
The Browser Engine
The product
property returns the product name of the browser engine:
Example
Do not rely on this. Most browsers returns "Gecko" as product name !!
The Browser Version
The appVersion
property returns version information about the browser:
Example
The Browser Agent
The userAgent
property returns the user-agent header sent by the browser to the server:
Example
Warning !!!
The information from the navigator object can often be misleading, and should not be used to detect browser versions because:
Different browsers can use the same name
The navigator data can be changed by the browser owner
Some browsers misidentify themselves to bypass site tests
Browsers cannot report new operating systems, released later than the browser
The Browser Platform
The platform
property returns the browser platform (operating system):
The Browser Language
The language
property returns the browser's language:
Is The Browser Online?
The onLine
property returns true if the browser is online:
Is Java Enabled?
The javaEnabled()
method returns true if Java is enabled:
Last updated
Was this helpful?