blob: c369c1891e7a85a397eaf5ae40118c8c963a4cc1 (
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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>
|