This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The NetworkInformation
interface provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. The NetworkInformation
interfaces cannot be instantiated. It is instead accessed through the connection
property of the Navigator
interface.
This interface also inherits properties of its parent, EventTarget
.
NetworkInformation.downlink
Read only
NetworkInformation.downlinkMax
Read only
NetworkInformation.effectiveType
Read only
NetworkInformation.rtt
Read only
NetworkInformation.type
Read only
bluetooth
cellular
ethernet
none
wifi
wimax
other
unknown
NetworkInformation.onchange
change
is fired on this object.This interface also inherits methods of its parent, EventTarget
.
Specification | Status | Comment |
---|---|---|
Network Information API The definition of 'NetworkInformation' in that specification. | Draft | Initial definition |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 61 | No | No | No | 48 | No |
Available in workers | 61 | No | No | ? | 48 | ? |
downlink
|
61 | No | No | ? | 48 | ? |
downlinkMax
|
61 | No | No | No | 48 | No |
effectiveType
|
61 | No | No | No | 48 | No |
onchange
|
61 | No | No | No | 48 | No |
rtt
|
61 | No | No | No | 48 | No |
type
|
61 | No | No | No | 48 | No |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 50 | 38 | ? | 31 | 37 | No | ? |
Available in workers | 50 | 38 | ? | 53 | 37 | ? | ? |
downlink
|
50 | 38 | ? | ? | 37 | ? | ? |
downlinkMax
|
50 | 38 | ? | No | 37 | No | ? |
effectiveType
|
50 | 38 | ? | Yes | 37 | ? | ? |
onchange
|
50 | 38 | ? | No
|
37 | No | ? |
rtt
|
50 | 38 | ? | No | 37 | No | ? |
type
|
50 | 38 | ? | No | 37 | No | ? |
Navigator
interface that implements it.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation