Packagedom.objects
Interfacepublic interface NavigatorID
Implementors Navigator

Objects implementing the Navigator interface must also implement the NavigatorID interface. This interface is defined separately so that other specifications can re-use parts of the Navigator interface.

See also

W3C - HTML 5: NavigatorID


Public Properties
 PropertyDefined By
  DOM 0 appName : DOMString
[read-only] Returns the official name of the browser.
NavigatorID
  DOM 0 appVersion : DOMString
[read-only] Returns the version of the browser.
NavigatorID
  DOM 0 platform : DOMString
[read-only] Returns a string representing the platform of the browser.
NavigatorID
  DOM 0 userAgent : DOMString
[read-only] Returns the user agent string for the current browser.
NavigatorID
Property Detail
DOM 0 appNameproperty
appName:DOMString  [read-only]

Introduced in: DOM 0 
Modified in: HTML 5 

Returns the official name of the browser.


Implementation
    public function get appName():DOMString

See also


Example
         dump(window.navigator.appName);
         // prints "Navigator" to the console for NS6
DOM 0 appVersionproperty 
appVersion:DOMString  [read-only]

Introduced in: DOM 0 
Modified in: HTML 5 

Returns the version of the browser.

Note: The window.navigator.userAgent property also contains the version number (example: "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1"), but you should be aware of how easy it is to change the user agent string and "spoof" other browsers, platforms, or user agents, and also how cavalier the browser vendor themselves are with these properties. The window.navigator.appVersion and window.navigator.userAgent properties are quite often used in "browser sniffing" code: scripts that attempt to find out what kind of browser you are using and adjust pages accordingly.


Implementation
    public function get appVersion():DOMString

See also


Example
         if ( navigator.appVersion.charAt(0) == "5" ) { 
             // browser is putatively a v5 browser
         }
DOM 0 platformproperty 
platform:DOMString  [read-only]

Introduced in: DOM 0 
Modified in: HTML 5 

Returns a string representing the platform of the browser.

Platform CodePlatform Name
HP-UXHP UNIX-based computers.
MacPPCMacintosh PowerPC-based computers.
Mac68KMacintosh 68K-based computers.
MacIntelMacintosh Intel-based computers.
Win32Microsoft Windows 32-bit platform.
Win16Windows 16-bit platform.
WinCEWindows CE platform.
Linux i686Linux i686
OtherOther

Note (Mozilla): Unless your code is privileged (chrome or at least has the UniversalBrowserRead privilege), it may get the value of the general.platform.override preference instead of the true platform.


Implementation
    public function get platform():DOMString

See also

DOM 0 userAgentproperty 
userAgent:DOMString  [read-only]

Introduced in: DOM 0 
Modified in: HTML 5 

Returns the user agent string for the current browser.

Note: Browser identification based on detecting the user agent string is unreliable and is not recommended, as the user agent string is user configurable.


Implementation
    public function get userAgent():DOMString

See also


Example
         alert(window.navigator.userAgent);
         // alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"