From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/api/networkinformation/index.html | 134 ++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 files/zh-cn/web/api/networkinformation/index.html (limited to 'files/zh-cn/web/api/networkinformation/index.html') 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 +--- +
{{APIRef("Network Information API")}}{{SeeCompatTable}}
+ +

NetworkInformation 提供有关设备正在使用的连接与网络进行通信的信息,并提供了在连接类型更改时通知脚本的事件。NetworkInformation 接口不能被是实例化, 而是通过 {{domxref("Navigator")}} 的 connection 属性进行访问。

+ +

{{AvailableInWorkers}}

+ +

Properties

+ +

这些属性接口继承自 {{domxref("EventTarget")}}.

+ +
+
{{domxref("NetworkInformation.type")}} {{readonlyinline}}
+
返回设备正在与网络进行通信的连接类型。 它将是以下值之一: +
    +
  • bluetooth
  • +
  • cellular
  • +
  • ethernet
  • +
  • none
  • +
  • wifi
  • +
  • wimax
  • +
  • other
  • +
  • unknown
  • +
+
+
{{domxref("NetworkInformation.downlinkMax")}} {{readonlyinline}}
+
返回基础连接技术的最大下载速度(Mbps)。
+
+ +

Event handlers

+ +
+
{{domxref("NetworkInformation.onchange")}}
+
当连接信息更改并在此对象上触发更改时触发的 {{event("change")}}  。
+
+ +

Methods

+ +

这些属性接口同样继承自 {{domxref("EventTarget")}}.

+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Network Information', '#idl-def-NetworkInformation', 'NetworkInformation')}}{{Spec2('Network Information')}}Initial definition
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support20 {{property_prefix("webkit")}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Basic support{{CompatVersionUnknown}}{{CompatNo}}{{CompatGeckoMobile(31)}} {{property_prefix("moz")}}[1]{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatVersionUnknown}}
Available in workers{{CompatUnknown}}{{CompatNo}}{{CompatGeckoMobile(53)}}{{CompatNo}}{{CompatNo}}{{CompatNo}}{{CompatUnknown}}
+
+ +

See also

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