Package | dom.objects |
Interface | public interface NavigatorID |
Implementors | Navigator |
See also
Property | Defined 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 |
DOM 0 appName | property |
appName:DOMString
[read-only] Introduced in: | DOM 0 |
Modified in: | HTML 5 |
Returns the official name of the browser.
public function get appName():DOMString
See also
dump(window.navigator.appName); // prints "Navigator" to the console for NS6
DOM 0 appVersion | property |
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.
public function get appVersion():DOMString
See also
if ( navigator.appVersion.charAt(0) == "5" ) { // browser is putatively a v5 browser }
DOM 0 platform | property |
platform:DOMString
[read-only] Introduced in: | DOM 0 |
Modified in: | HTML 5 |
Returns a string representing the platform of the browser.
Platform Code | Platform Name |
---|---|
HP-UX | HP UNIX-based computers. |
MacPPC | Macintosh PowerPC-based computers. |
Mac68K | Macintosh 68K-based computers. |
MacIntel | Macintosh Intel-based computers. |
Win32 | Microsoft Windows 32-bit platform. |
Win16 | Windows 16-bit platform. |
WinCE | Windows CE platform. |
Linux i686 | Linux i686 |
Other | Other |
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.
public function get platform():DOMString
See also
DOM 0 userAgent | property |
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.
public function get userAgent():DOMString
See also
alert(window.navigator.userAgent); // alerts "Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1"