Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

window.navigator.appVersion

概要

ブラウザのバージョンを表す文字列を返します。

Note: Do not rely on this property to return the correct browser version. In Gecko-based browsers (like Firefox) and WebKit-based browsers (like Chrome and Safari) the returned value starts with "5.0" followed by platform information. In Opera 10 and newer the returned version does not match the actual browser version, either.

構文

window.navigator.appVersion

戻り値

  • ver は、ブラウザのバージョン番号を表す文字列です。

alert("ご使用中のブラウザのバージョンナンバー(※推定値): " + navigator.appVersion);

注記

window.navigator.userAgent プロパティもバージョン番号を含んでいる場合があります(※例:"Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape 6/6.1")。しかしユーザエージェントを表す文字列を変更し、他のブラウザ、プラットフォーム、あるいは、ユーザエージェントであるかのように "偽装 (spoof)" することは容易であり、またブラウザベンダ自身のこれらのプロパティ対する扱いも無軌道なものであるということは、覚えておくべきです。 window.navigator.appVersion と window.navigator.userAgent プロパティは、"ブラウザ判別 (browser sniffing)" のコードで非常にしばしば用いられます。例えば、使用中のブラウザの種類を調べ、それに従いページを調整するスクリプトなどです。

The window.navigator.appVersion, window.navigator.appName and window.navigator.userAgent properties have been used in "browser sniffing" code: scripts that attempt to find out what kind of browser you are using and adjust pages accordingly. This lead to the current situation, where browsers had to return fake values from these properties in order not to be locked out of some websites.

仕様

元々は DOM Level 0 に含まれてるものでした(※即ち、仕様書に含まれていなかった)。現在では HTML5 仕様書に含まれています。

ドキュメントのタグと貢献者

タグ: 
 このページの貢献者: fscholz, khalid32, ethertank, Potappo
 最終更新者: khalid32,