diff options
| author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
|---|---|---|
| committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
| commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
| tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/networkinformation | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/ja/web/api/networkinformation')
| -rw-r--r-- | files/ja/web/api/networkinformation/downlinkmax/index.html | 122 | ||||
| -rw-r--r-- | files/ja/web/api/networkinformation/index.html | 130 | ||||
| -rw-r--r-- | files/ja/web/api/networkinformation/onchange/index.html | 110 | ||||
| -rw-r--r-- | files/ja/web/api/networkinformation/type/index.html | 126 |
4 files changed, 488 insertions, 0 deletions
diff --git a/files/ja/web/api/networkinformation/downlinkmax/index.html b/files/ja/web/api/networkinformation/downlinkmax/index.html new file mode 100644 index 0000000000..c369c1891e --- /dev/null +++ b/files/ja/web/api/networkinformation/downlinkmax/index.html @@ -0,0 +1,122 @@ +--- +title: NetworkInformation.downlinkMax +slug: Web/API/NetworkInformation/downlinkMax +tags: + - API + - Experimental + - Network Information API + - NetworkInformation + - Property + - Read-only + - Reference +translation_of: Web/API/NetworkInformation/downlinkMax +--- +<p>{{APIRef("Network Information API")}}{{SeeCompatTable}}</p> + +<p><strong><code>NetworkInformation.downlinkMax</code></strong> 読み取り専用プロパティは、メガビット毎秒(Mbps)単位で、基底の接続技術の最大下り速度を返します。</p> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox">var <em>max</em> = NetworkInformation.<em>downlinkMax</em></pre> + +<h3 id="戻り値">戻り値</h3> + +<ul> + <li>メガビット毎秒(Mbps)単位で、基底の接続技術の最大下り速度を表す<code>無制限のdouble</code>。</li> +</ul> + +<h2 id="例">例</h2> + +<p>次の例は、<code>change</code> イベントで接続をモニターして、発生した変更をロギングしています。</p> + +<pre class="brush: js"><code>function logConnectionType() { + var connectionType = 'not supported'; + var downlinkMax = 'not supported'; + + if ('connection' in navigator) { + connectionType = navigator.connection.type; + + if ('downlinkMax' in navigator.connection) { + downlinkMax = navigator.connection.downlinkMax; + } + } + + console.log('Current connection type: ' + connectionType + + ' (downlink max: ' + downlinkMax + ')'); +} + +logConnectionType(); +navigator.connection.addEventListener('change', logConnectionType);</code></pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Network Information', '#widl-NetworkInformation-downlinkMax', 'downlinkMax')}}</td> + <td>{{Spec2('Network Information')}}</td> + <td>最初の定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザ実装状況">ブラウザ実装状況</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatChrome(48.0)}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Android</th> + <th>Android Webview</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + <th>Chrome for Android</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatChrome(48.0)}}</td> + </tr> + </tbody> +</table> +</div> diff --git a/files/ja/web/api/networkinformation/index.html b/files/ja/web/api/networkinformation/index.html new file mode 100644 index 0000000000..c59961e5f9 --- /dev/null +++ b/files/ja/web/api/networkinformation/index.html @@ -0,0 +1,130 @@ +--- +title: NetworkInformation +slug: Web/API/NetworkInformation +tags: + - API + - Experimental + - Interface + - Network Information API + - Reference +translation_of: Web/API/NetworkInformation +--- +<div>{{APIRef("Network Information API")}}{{SeeCompatTable}}</div> + +<p><code><strong>NetworkInformation</strong></code> インターフェースは、デバイスがネットワーク通信に使用している接続の情報を提供します。また、接続の種類が変更した場合、スクリプトに通知する手段を提供します。<code>NetworkInformation</code> インターフェースは、インスタンス生成できません。代わりに、{{domxref("Navigator")}} インターフェースの <code>connection</code> プロパティを通してアクセスします。</p> + +<h2 id="プロパティ">プロパティ</h2> + +<p><em>このインターフェースは、親である {{domxref("EventTarget")}} のプロパティも継承しています。</em></p> + +<dl> + <dt>{{domxref("NetworkInformation.type")}} {{readonlyinline}}</dt> + <dd>デバイスがネットワーク通信に使用している接続の種類を返す。値は次のうちのいずれかである: + <ul> + <li><code>bluetooth</code></li> + <li><code>cellular</code></li> + <li><code>ethernet</code></li> + <li><code>none</code></li> + <li><code>wifi</code></li> + <li><code>wimax</code></li> + <li><code>other</code></li> + <li><code>unknown</code></li> + </ul> + </dd> + <dt>{{domxref("NetworkInformation.downlinkMax")}} {{readonlyinline}}</dt> + <dd>メガビット毎秒(Mbps)単位で、基底の接続技術の最大下り速度を返す。</dd> +</dl> + +<h3 id="イベントハンドラ">イベントハンドラ</h3> + +<dl> + <dt>{{domxref("NetworkInformation.onchange")}}</dt> + <dd>接続情報が変更されたときに発火するイベントで、このオブジェクトで {{event("change")}} が発火する。</dd> +</dl> + +<h2 id="メソッド">メソッド</h2> + +<p><em>このインターフェースは、親である {{domxref("EventTarget")}} のメソッドを継承しています。</em></p> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Network Information', '#idl-def-NetworkInformation', 'NetworkInformation')}}</td> + <td>{{Spec2('Network Information')}}</td> + <td>最初の定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザ実装状況">ブラウザ実装状況</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>基本サポート</td> + <td>20 {{property_prefix("webkit")}}</td> + <td>31.0 {{property_prefix("moz")}}<sup>[1]</sup></td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Android</th> + <th>Android Webview</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + <th>Chrome for Android</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>31.0 {{property_prefix("moz")}}<sup>[1]</sup></td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Network API は、<code>dom.network.enabled</code> 設定で無効化できます。Gecko 12.0 から Gecko 30.0 に含まれており、このインターフェースは <code>Connection</code> と呼ばれており、異なるメンバーを持っていました。Gecko 12.0 では、Android システムでのみ Network API が実装されていました。Linux ({{bug("712442")}}) と Windows ({{bug("721306")}}) でのサポートは進行中です。</p> + +<h2 id="関連項目">関連項目</h2> + +<ul> + <li><a href="/ja/docs/Web/API/Network_Information_API">Network Information API</a></li> + <li><a href="/ja/docs/Online_and_offline_events">Online and offline events</a></li> + <li>これを実装している {{domxref("Navigator")}} インターフェース。</li> +</ul> diff --git a/files/ja/web/api/networkinformation/onchange/index.html b/files/ja/web/api/networkinformation/onchange/index.html new file mode 100644 index 0000000000..e29f1d538c --- /dev/null +++ b/files/ja/web/api/networkinformation/onchange/index.html @@ -0,0 +1,110 @@ +--- +title: NetworkInformation.onchange +slug: Web/API/NetworkInformation/onchange +tags: + - API + - Event Handler + - Experimental + - Network Information API + - NetworkInformation + - Property + - Reference +translation_of: Web/API/NetworkInformation/onchange +--- +<p>{{apiref("Network Information API")}}{{SeeCompatTable}}</p> + +<p><strong><code>NetworkInformation.onchange</code></strong> イベントハンドラは、接続情報が変化したときに発火し、{{domxref("NetworkInformation")}} オブジェクトが {{event("change")}} を受け取るコードを含みます。</p> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox"><em>netInfo</em>.onchange = function() { ... } +</pre> + +<h2 id="例">例</h2> + +<pre class="brush: js">// 接続型の取得 +var type = navigator.connection.type; + +function changeHandler(e) { + // ここで接続型の変更を操作する +} + +// change イベントの登録: +navigator.connection.onchange = changeHandler; + +// Another way: navigator.connection.addEventListener('change', changeHandler);</pre> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Network Information')}}</td> + <td>{{Spec2('Network Information')}}</td> + <td>最初の定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザ実装状況">ブラウザ実装状況</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatChrome(47)}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Android</th> + <th>Android Webview</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + <th>Chrome for Android</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}} [1]</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<p>[1] Firefox では、イベントハンドラで送信される <code>typechange</code> イベントは、<code>ontypechange</code> です。</p> diff --git a/files/ja/web/api/networkinformation/type/index.html b/files/ja/web/api/networkinformation/type/index.html new file mode 100644 index 0000000000..3511864e0e --- /dev/null +++ b/files/ja/web/api/networkinformation/type/index.html @@ -0,0 +1,126 @@ +--- +title: NetworkInformation.type +slug: Web/API/NetworkInformation/type +tags: + - API + - Experimental + - Network Information API + - NetworkInformation + - Property + - Read-only + - Reference +translation_of: Web/API/NetworkInformation/type +--- +<p>{{apiref("Network Information API")}}{{SeeCompatTable}}</p> + +<p><code><strong>NetworkInformation.type</strong></code> 読み取り専用プロパティは、デバイスがネットワーク通信に使用している接続の種類を返します。</p> + +<h2 id="構文">構文</h2> + +<pre class="syntaxbox">var <em>type</em> = <em>netInfo</em>.type</pre> + +<h3 id="戻り値">戻り値</h3> + +<p>次の値のいずれかである列挙値です:</p> + +<ul> + <li><code>"bluetooth"</code></li> + <li><code>"cellular"</code></li> + <li><code>"ethernet"</code></li> + <li><code>"none</code>"</li> + <li><code>"wifi"</code></li> + <li><code>"wimax"</code></li> + <li><code>"other"</code></li> + <li><code>"unknown"</code></li> +</ul> + +<h2 id="仕様">仕様</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">仕様</th> + <th scope="col">ステータス</th> + <th scope="col">コメント</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('Network Information', '#widl-NetworkInformation-type', 'type')}}</td> + <td>{{Spec2('Network Information')}}</td> + <td>最初の定義</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザ実装状況">ブラウザ実装状況</h2> + +<p>{{CompatibilityTable}}</p> + +<div id="compat-desktop"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Chrome</th> + <th>Firefox (Gecko)</th> + <th>Internet Explorer</th> + <th>Opera</th> + <th>Safari</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoDesktop("31")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + <tr> + <td><code>unknown</code></td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoDesktop("33")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<div id="compat-mobile"> +<table class="compat-table"> + <tbody> + <tr> + <th>機能</th> + <th>Android</th> + <th>Android Webview</th> + <th>Firefox Mobile (Gecko)</th> + <th>IE Mobile</th> + <th>Opera Mobile</th> + <th>Safari Mobile</th> + <th>Chrome for Android</th> + </tr> + <tr> + <td>基本サポート</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("31")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + </tr> + <tr> + <td><code>unknown</code></td> + <td>{{CompatNo}}</td> + <td>{{CompatVersionUnknown}}</td> + <td>{{CompatGeckoMobile("33")}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> |
