From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../ja/web/api/navigatorid/appcodename/index.html | 26 +++++ files/ja/web/api/navigatorid/appname/index.html | 26 +++++ files/ja/web/api/navigatorid/appversion/index.html | 35 ++++++ files/ja/web/api/navigatorid/index.html | 122 +++++++++++++++++++++ files/ja/web/api/navigatorid/platform/index.html | 65 +++++++++++ files/ja/web/api/navigatorid/product/index.html | 38 +++++++ files/ja/web/api/navigatorid/useragent/index.html | 86 +++++++++++++++ 7 files changed, 398 insertions(+) create mode 100644 files/ja/web/api/navigatorid/appcodename/index.html create mode 100644 files/ja/web/api/navigatorid/appname/index.html create mode 100644 files/ja/web/api/navigatorid/appversion/index.html create mode 100644 files/ja/web/api/navigatorid/index.html create mode 100644 files/ja/web/api/navigatorid/platform/index.html create mode 100644 files/ja/web/api/navigatorid/product/index.html create mode 100644 files/ja/web/api/navigatorid/useragent/index.html (limited to 'files/ja/web/api/navigatorid') diff --git a/files/ja/web/api/navigatorid/appcodename/index.html b/files/ja/web/api/navigatorid/appcodename/index.html new file mode 100644 index 0000000000..42f0aaccbc --- /dev/null +++ b/files/ja/web/api/navigatorid/appcodename/index.html @@ -0,0 +1,26 @@ +--- +title: window.navigator.appCodeName +slug: Web/API/NavigatorID/appCodeName +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference +translation_of: Web/API/NavigatorID/appCodeName +--- +
+ {{ApiRef}}
+

概要

+

現在のブラウザの内部 "コード" ネームを返します。

+

構文

+
codeName = window.navigator.appCodeName
+ +

+
console.log(window.navigator.appCodeName);
+
+

注記

+

Mozilla、Netscape 6、IE5 は全て、内部名に "Mozilla" を用いています。

+

仕様

+

{{DOM0()}}

diff --git a/files/ja/web/api/navigatorid/appname/index.html b/files/ja/web/api/navigatorid/appname/index.html new file mode 100644 index 0000000000..eef3b58fe9 --- /dev/null +++ b/files/ja/web/api/navigatorid/appname/index.html @@ -0,0 +1,26 @@ +--- +title: window.navigator.appName +slug: Web/API/NavigatorID/appName +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference + - 要更新 +translation_of: Web/API/NavigatorID/appName +--- +
+ {{ApiRef}}
+

概要

+

ブラウザの公式な名前を返します。

+

構文

+
appName = window.navigator.appName
+ +

+
dump(window.navigator.appName);
+// NS6 のコンソールに "Navigator" を出力します。
+
+

仕様

+

{{DOM0}}

diff --git a/files/ja/web/api/navigatorid/appversion/index.html b/files/ja/web/api/navigatorid/appversion/index.html new file mode 100644 index 0000000000..10287d3bc1 --- /dev/null +++ b/files/ja/web/api/navigatorid/appversion/index.html @@ -0,0 +1,35 @@ +--- +title: window.navigator.appVersion +slug: Web/API/NavigatorID/appVersion +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference + - 要更新 +translation_of: Web/API/NavigatorID/appVersion +--- +
+ {{ApiRef}}
+

概要

+

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

+
+ 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
+
+

戻り値

+ +

+
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 仕様書に含まれています。

diff --git a/files/ja/web/api/navigatorid/index.html b/files/ja/web/api/navigatorid/index.html new file mode 100644 index 0000000000..d311d05b98 --- /dev/null +++ b/files/ja/web/api/navigatorid/index.html @@ -0,0 +1,122 @@ +--- +title: NavigatorID +slug: Web/API/NavigatorID +tags: + - API +translation_of: Web/API/NavigatorID +--- +

{{APIRef("HTML DOM")}}

+ +

The NavigatorID interface contains methods and properties related to the identity of the browser.

+ +

There is no object of type NavigatorID, but other interfaces, like {{domxref("Navigator")}} or {{domxref("WorkerNavigator")}}, implement it.

+ +

Properties

+ +

The NavigatorID interface doesn't inherit any property.

+ +
+
{{domxref("NavigatorID.appCodeName")}} {{readonlyInline}}{{deprecated_inline}}
+
Always returns 'Mozilla', on any browser. This property is kept only for compatibility purpose.
+
{{domxref("NavigatorID.appName")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns the official name of the browser. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.appVersion")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns the version of the browser as a string. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.platform")}} {{readonlyInline}} {{deprecated_inline}}
+
Returns a string representing the platform of the browser. Do not rely on this property to return the correct value.
+
{{domxref("NavigatorID.product")}} {{readonlyInline}} {{deprecated_inline}}
+
Always returns 'Gecko', on any browser. This property is kept only for compatibility purpose.
+
{{domxref("NavigatorID.userAgent")}} {{readonlyInline}}
+
Returns the user agent string for the current browser.
+
+ +

Methods

+ +

The NavigatorID interface doesn't inherit any method.

+ +
+
{{domxref("NavigatorID.taintEnabled()")}} {{deprecated_inline()}}
+
Always returns false. JavaScript taint/untaint functions were removed in JavaScript 1.2. This method is only kept for compatibility purpose
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML WHATWG')}}Added the appCodeName property and the taintEnabled() method,  for compatibility purpose.
{{SpecName('HTML5 W3C', '#navigatorid', 'NavigatorID')}}{{Spec2('HTML5 W3C')}}Initial specification.
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + diff --git a/files/ja/web/api/navigatorid/platform/index.html b/files/ja/web/api/navigatorid/platform/index.html new file mode 100644 index 0000000000..508dec6cfc --- /dev/null +++ b/files/ja/web/api/navigatorid/platform/index.html @@ -0,0 +1,65 @@ +--- +title: NavigatorID.platform +slug: Web/API/NavigatorID/platform +tags: + - API + - Navigator + - NavigatorID + - Property + - Reference + - platform +translation_of: Web/API/NavigatorID/platform +--- +

{{APIRef("HTML DOM")}}

+ +

ブラウザーのプラットフォームを表す文字列を返します。仕様書ではブラウザーが常に空文字列を返すことを許可していますので、信頼できる答えを得るためにこのプロパティを頼らないようにしてください。

+ +

構文

+ +
platform = navigator.platform
+
+ + + +

+ +

ブラウザーを実行しているプラットフォームを識別する {{domxref("DOMString")}}、あるいはブラウザーがプラットフォームの識別を断る (または識別できない) 場合は空文字列になります。platform は空文字列か、ブラウザーを実行しているプラットフォームを表す文字列でなければなりません。

+ +

例: "MacIntel", "Win32", "FreeBSD i386", "WebTV OS"

+ +

+ +
console.log(navigator.platform);
+ +

注記

+ +

Chrome、Edge、Firefox 63 以降を含むほとんどのブラウザーは、64 ビット版の Windows で実行していても "Win32" を返します。Internet Explorer やバージョン 63 より前の Firefox は "Win64" を返します。

+ +

Firefox は設定項目 general.platform.override で、このプロパティが返す値を上書きできます。

+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様書策定状況コメント
{{SpecName('HTML WHATWG', '#dom-navigator-platform', 'NavigatorID.platform')}}{{Spec2('HTML WHATWG')}}初期定義
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.NavigatorID.platform")}}

diff --git a/files/ja/web/api/navigatorid/product/index.html b/files/ja/web/api/navigatorid/product/index.html new file mode 100644 index 0000000000..33d2f462c1 --- /dev/null +++ b/files/ja/web/api/navigatorid/product/index.html @@ -0,0 +1,38 @@ +--- +title: window.navigator.product +slug: Web/API/NavigatorID/product +tags: + - DOM + - DOM_0 + - Gecko + - Gecko DOM Reference +translation_of: Web/API/NavigatorID/product +--- +
+ {{ApiRef}}
+

概要

+

このプロパティは、現在のブラウザの製品名を返します。

+

構文

+
productName = window.navigator.product
+
+ +

+
<script>
+function prod() {
+  dt = document.getElementById("d");
+  dt.innerHTML = window.navigator.product;
+}
+</script>
+
+<button onclick="prod();">product</button>
+<div id="d"> </div>
+
+<!-- "Gecko" などの文字列が表示される -->
+
+

注記

+

製品名は、ユーザエージェント全体の文字列の一部(プラットフォームの直後)です。例えば、Netscape 6.1 を表すユーザエージェントでは、製品名は、"Gecko" であり、ユーザエージェント文字列全体は、次の通りです。

+
Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010725 Netscape6/6.1
+

仕様

+

{{DOM0}}

diff --git a/files/ja/web/api/navigatorid/useragent/index.html b/files/ja/web/api/navigatorid/useragent/index.html new file mode 100644 index 0000000000..753c7729dc --- /dev/null +++ b/files/ja/web/api/navigatorid/useragent/index.html @@ -0,0 +1,86 @@ +--- +title: NavigatorID.userAgent +slug: Web/API/NavigatorID/userAgent +tags: + - API + - Deprecated + - NavigatorID + - Property + - Read-only + - Reference +translation_of: Web/API/NavigatorID/userAgent +--- +

{{ApiRef("HTML DOM")}}

+ +

NavigatorID.userAgent は読み取り専用のプロパティで、現在のブラウザーのユーザーエージェント文字列を返します。

+ +
+

仕様書では、ブラウザーがこのフィールドを介して提供する情報をできるだけ少なくすることを求めています。このプロパティの値は、同じブラウザーの将来のバージョンでも同じままであると仮定してはいけません。まったく使用しないようにしたり、ブラウザーの現在のバージョンと過去のバージョンのためだけに使用するようにしてください。新しいブラウザーは、古いブラウザーと同じ UA、またはその一部を使い始めるかもしれません。ブラウザーエージェントが本当にこのプロパティによって広告されたものであるという保証は本当にありません。
+
+また、ブラウザのユーザーはこのフィールドの値を変更することができることを覚えておいてください (UA なりすまし)。

+
+ +

ユーザーエージェント文字列の検出に基づくブラウザーの識別は信頼性が低く、ユーザーエージェント文字列はユーザーが設定可能なので推奨されません。例えば、以下のようになります。

+ + + +

構文

+ +
var ua = navigator.userAgent;
+
+ +

+ +

{{domxref("DOMString")}} で、ブラウザーが {{Glossary("HTTP")}} ヘッダーで提供する完全なユーザーエージェント文字列と、 {{domxref("Navigator")}} オブジェクト上のメソッドやその他の関連メソッドへのレスポンスを指定します。

+ +

ユーザーエージェント文字列は形式的な構造に基づいて構築されており、いくつかの情報に分解することができます。これらの情報の各部分は、ユーザ-が設定可能な他の Navigator のプロパティから来ています。Gecko ベースのブラウザは以下の一般的な構造に準拠しています。

+ +
userAgent = appCodeName/appVersion number (Platform; Security; OS-or-CPU;
+Localization; rv: revision-version-number) product/productSub
+Application-Name Application-Name-version
+
+ +

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

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-navigator-useragent', 'NavigatorID.userAgent')}}{{Spec2('HTML WHATWG')}}初回定義
+ +

ブラウザーの互換性

+ + + +

{{Compat("api.NavigatorID.userAgent")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf