Network Information: navigator.connection.metered
- Category
- Network / Connectivity
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- Start incubating
Summary
Some operating systems like Windows or Android let users annotate certain network connections as metered, for example, to avoid operating system updates to be downloaded on the on-board Wi-Fi of an airplane, where each megabyte of data may be very expensive. This feature adds a boolean flag `metered` to the `NetworkConnection` interface (`navigator.connection.metered`) to inform developers of whether the current network is metered as per this operating system setting.
Motivation
More and more devices are permanently connected to the Internet, and connectivity is a fundamental requirement for many. Network connectivity depends on a lot of factors, some of which include the connection type (e.g., Wi-Fi, 3G, 4G, 5G, etc.), but also factors like the device's physical location (e.g., Wi-Fi on a moving train), or the user's preferences (e.g., a desire to not overly tax a data connection shared with others). Naive assumptions like "connected to Wi-Fi always means connectivity is granted and data is cheap" or the opposite "connected to cellular always means connectivity is spotty and data is expensive" no longer hold true, and in many cases never did. The Network Information API aims to provide a standard approach for web applications to query the current network status in a meaningful and privacy-preserving way.
Standards & signals
- Specification: https://raw.githack.com/tomayac/netinfo/relaunch/index.html
- Firefox: Negative — The feedback was mostly focused on `sustainedSpeed`, but not `metered`.
- Safari: Negative — The feedback was mostly focused on `metered`, but not `sustainedSpeed`.
- Web developers: Positive — See the "User Needs" section of https://goo.gle/netinfo-reboot-motivation
- Tracking bug: https://crbug.com/1311964
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=network-information-navigator-connection-metered
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Network%20Information%3A%20navigator.connection.metered
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Network%20Information%3A%20navigator.connection.metered
- Baseline status: https://webstatus.dev/?q=Network%20Information%3A%20navigator.connection.metered
Explainers: https://github.com/tomayac/netinfo/blob/relaunch/README.md https://goo.gle/netinfo-reboot-motivation