Search within TutorialsPark

Javascript BOM : Navigator Object


Exploit the Navigator object to get details about browser and its extensions and plugins.


Javascript Browser Object Model : Navigator Object

The JavaScript window object property of navigator is used refer to the Navigator object, which contains all information related to browser, it vendor , version, plugins etc.

Earlier Navigator object was used only to determine whether clients systems were running, Internet Explorer or Netscape i.e browser-sniffing

Currently the navigator object can be used to check the Browser Version, whether Java is enabled, plugins attached etc.


Javascript Navigator Object: Properties

Property Description
appCodeName The Code name of the Browser.
appName The name of the Browser.
appVersion Specifies the Version of the Browser.
mimeTypes Array of MIME types registered with the browser.
platforms The operation system on which the browser runs.
userAgent The HTTP user-agent header sent from the browser to the server.

In the below demo, the special loop is used to assign each property of the navigator object to variable navigatorProperty.

Example: Javascript Navigator Object Properties

Give it a TRY! » Note: Each property and its value is displayed against each other.


Javascript Navigator Object : Plug-In Detection

The Navigator object is used mostly to detect the presence of plug-ins installed on the browser, it uses the plugins array for that purpose. The items in the array comprise of the following property.

name : The plug-in name.

description : The plug-in name.

filename : The filename of the plug-in.

length : The number of MIME types handled by the plugin.

Plug-Ins are programs which can be used by the browser to add abilities to play audio files, videos, animation, view PDF files etc. Eg: Adobe Acrobat Reader, Shockwave/Flash Player etc.

Example: Javascript Navigator Object Plug-In Detection

Give it a TRY! » Note: The plugins[] array contains all plugins installed on the browser.


Javascript Navigator Object : Get all Browser Information.

The JavaScript navigator object has a set of properties which can be used to get all browser Information, these properties can help you customise the Web Page.

Example : Javascript Navigator Object : Get Browser Information

Give it a TRY! » Note: The property platform specifies the operating system on which the browser is running.


Javascript Navigator Object : MIME Types

MIME(Multipurpose Internet Mail Extension) specifies the protocol standard used to exchange different types of data files over the Internet. Eg: Audio, video, text etc.

The mimeType object are predefined and are used to access the mimeTypes[] array which belongs to both the navigator object and plugin object.

Javascript Navigator Object: Properties

Property Description
description To provide description about the MIME Type.
enabledPlugin To point to the plugin object for the specified MIME type.
suffixes The extension of the file. Eg .png, .pdf
type To name the MIME type. eg: image/png

Example : Javascript Navigator Object : Get Browser Information

Give it a TRY! » Note: If the values are empty, it means that MIME type is null.