aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/networkinformation/downlinkmax/index.html
blob: 0f0f53b9783684571d5f3495aa16a7d84f555aae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
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>{{Compat("api.NetworkInformation.downlinkMax")}}</p>