Network InformationLimited availability
The navigator.connection API provides information about the network connection a device is using and fires events when the connection type changes.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
✕Not supportedup to 155
Current: 155Edge
✕Not supportedup to 154
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–66Not supported
67+Supportedsince May 31, 2018
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Chrome, Edge, Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: connection.
Feature detection
JS · check before using
if ("NetworkInformation" in globalThis) {
// NetworkInformation is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (13). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Navigator.connection | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.change_event | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.downlink | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.downlinkMax | ✕ | ✕ | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.effectiveType | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.rtt | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.type | ✕ | ✕ | ✕ | ✕ | 38 | ✕ | ✕ |
| NetworkInformation.worker_support | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| WorkerNavigator.connection | 61 | 79 | ✕ | ✕ | 38 | ✕ | ✕ |
| http.headers.Downlink | 67 | 79 | ✕ | ✕ | 67 | ✕ | ✕ |
| http.headers.ECT | 67 | 79 | ✕ | ✕ | 67 | ✕ | ✕ |
| http.headers.RTT | 67 | 79 | ✕ | ✕ | 67 | ✕ | ✕ |