Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Navigator
  4. appVersion

Navigator: appVersion property

TheNavigator.appVersion read-only property of theNavigator interface returns a string representing version information about the browser.

Value

A string.

Description

TheappVersion property returns information indicating the browser version.

Note that the information returned varies significantly by browser. In some browsers, such as Chrome, this is nearly the same as the value returned byNavigator.userAgent, with theMozilla/ prefix removed. For example:

5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

In other browsers, such as Firefox, this is cut down to a short string that hints at the platform/OS. For example:

5.0 (Macintosh)

Theoretically this information is useful for detecting the browser and serving code to work around browser-specific bugs or lack of feature support. However, this isunreliable andis not recommended for the reasons given inUser-Agent reduction andBrowser detection using the user agent.

Feature detection is a much more reliable strategy.

Examples

js
console.log(navigator.appVersion);// On Chrome, logs something like "5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36" (reduced UA string)// On Firefox, logs something like "5.0 (Macintosh)"

Specifications

Specification
HTML
# dom-navigator-appversion-dev

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp