aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/networkinformation
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/networkinformation')
-rw-r--r--files/zh-cn/web/api/networkinformation/downlink/index.html105
-rw-r--r--files/zh-cn/web/api/networkinformation/index.html134
-rw-r--r--files/zh-cn/web/api/networkinformation/rtt/index.html106
-rw-r--r--files/zh-cn/web/api/networkinformation/savedata/index.html35
4 files changed, 380 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/networkinformation/downlink/index.html b/files/zh-cn/web/api/networkinformation/downlink/index.html
new file mode 100644
index 0000000000..8b3e902217
--- /dev/null
+++ b/files/zh-cn/web/api/networkinformation/downlink/index.html
@@ -0,0 +1,105 @@
+---
+title: NetworkInformation.downlink
+slug: Web/API/NetworkInformation/downlink
+translation_of: Web/API/NetworkInformation/downlink
+---
+<p>{{SeeCompatTable}}{{APIRef("Network Information API")}}</p>
+
+<p><strong><code>downlink</code></strong> 是 {{domxref("NetworkInformation")}} 接口的一个只读属性,返回以Mb/s为单位的有效带宽,并保留该值为25kb/s的最接近的整数倍。该值基于最近监测的保持活跃连接的应用层吞吐量,排除了到私有地址空间的连接。当缺少最近的带宽测量数据时,该属性由底层连接技术属性决定。</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox">var <em>downLink</em> = NetworkInformation.downlink</pre>
+
+<h3 id="Value">Value</h3>
+
+<p>{{jsxref("double")}} 双精度浮点数。</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('Network Information','#dom-networkinformation-downlink','downlink')}}</td>
+ <td>{{Spec2('Network Information')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_Compatibility">Browser Compatibility</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(61)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(48)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatChrome(61)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOpera(48)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>Firefox OS</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(50)}}</td>
+ <td>{{CompatChrome(38)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOperaMobile(37)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatChrome(50)}}</td>
+ <td>{{CompatChrome(38)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatOperaMobile(37)}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/networkinformation/index.html b/files/zh-cn/web/api/networkinformation/index.html
new file mode 100644
index 0000000000..a78634c7ed
--- /dev/null
+++ b/files/zh-cn/web/api/networkinformation/index.html
@@ -0,0 +1,134 @@
+---
+title: NetworkInformation
+slug: Web/API/NetworkInformation
+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>
+
+<p>{{AvailableInWorkers}}</p>
+
+<h2 id="Properties">Properties</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="Event_handlers">Event handlers</h3>
+
+<dl>
+ <dt>{{domxref("NetworkInformation.onchange")}}</dt>
+ <dd>当连接信息更改并在此对象上触发更改时触发的 {{event("change")}}  。</dd>
+</dl>
+
+<h2 id="Methods">Methods</h2>
+
+<p><em>这些属性接口同样继承自 {{domxref("EventTarget")}}.</em></p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Network Information', '#idl-def-NetworkInformation', 'NetworkInformation')}}</td>
+ <td>{{Spec2('Network Information')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>20 {{property_prefix("webkit")}}</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>Feature</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>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatGeckoMobile(31)}} {{property_prefix("moz")}}<sup>[1]</sup></td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatGeckoMobile(53)}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a href="/en-US/docs/Web/API/Network_Information_API">Network Information API</a></li>
+ <li><a href="/en-US/docs/Online_and_offline_events">Online and offline events</a></li>
+ <li>The {{domxref("Navigator")}} interface that implements it.</li>
+</ul>
diff --git a/files/zh-cn/web/api/networkinformation/rtt/index.html b/files/zh-cn/web/api/networkinformation/rtt/index.html
new file mode 100644
index 0000000000..94f0815718
--- /dev/null
+++ b/files/zh-cn/web/api/networkinformation/rtt/index.html
@@ -0,0 +1,106 @@
+---
+title: NetworkInformation.rtt
+slug: Web/API/NetworkInformation/rtt
+translation_of: Web/API/NetworkInformation/rtt
+---
+<p>{{apiref("Network Information API")}}{{SeeCompatTable}}</p>
+
+<p><strong>NetworkInformation.rtt </strong>是一个只读属性,返回了当前连接下评估的往返时延(RTT, round-trip time ),并保留该值为25千分秒的最接近的整数倍。该值基于最近使用中被监测的最近保持活跃连接的应用层上的RTT测量值。它排除了到私有地址空间的连接。如果没有最近的测量数据,该值就基于底层连接技术的属性。</p>
+
+<p>{{AvailableInWorkers}}</p>
+
+<h2 id="Syntax">Syntax</h2>
+
+<pre class="syntaxbox"><em>rtt</em> = NetworkInformation.rtt</pre>
+
+<h3 id="Return_value">Return value</h3>
+
+<p>一个数字。</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Network Information', '#dom-networkinformation-rtt', 'rtt')}}</td>
+ <td>{{Spec2('Network Information')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(61)}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera(48)}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatChrome(61)}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOpera(48)}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android Webview</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatChrome(50)}}</td>
+ <td>{{CompatChrome(38)}}</td>
+ <td>{{CompatGeckoMobile("31")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOperaMobile(37)}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ <tr>
+ <td>Available in workers</td>
+ <td>{{CompatChrome(50)}}</td>
+ <td>{{CompatChrome(38)}}</td>
+ <td>{{CompatGeckoMobile("53")}}</td>
+ <td>{{CompatNo}}</td>
+ <td>{{CompatOperaMobile(37)}}</td>
+ <td>{{CompatNo}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
diff --git a/files/zh-cn/web/api/networkinformation/savedata/index.html b/files/zh-cn/web/api/networkinformation/savedata/index.html
new file mode 100644
index 0000000000..e59c5e2c3f
--- /dev/null
+++ b/files/zh-cn/web/api/networkinformation/savedata/index.html
@@ -0,0 +1,35 @@
+---
+title: NetworkInformation.saveData
+slug: Web/API/NetworkInformation/saveData
+translation_of: Web/API/NetworkInformation/saveData
+---
+<div>{{APIRef("Network Information API")}}{{SeeCompatTable}}</div>
+
+<p class="summary"><strong><code>NetworkInformation.saveData</code></strong> 是 {{domxref("NetworkInformation")}} 接口的只读属性, 如果用户设备上设置了减少数据使用的选项时返回 <code>true</code> .</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox notranslate">var saveData = NetworkInformation.saveData;</pre>
+
+<h3 id="返回值">返回值</h3>
+
+<p>A {{jsxref('Boolean')}}.</p>
+
+<h2 id="参考">参考</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">参考</th>
+ </tr>
+ <tr>
+ <td><a href="https://wicg.github.io/savedata/#dfn-savedata">Save Data API</a></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+
+
+<p>{{Compat("api.NetworkInformation.saveData")}}</p>