This demo illustrates the use of the
Network Information API
to retrieve the current network type and monitor for network type changes.
While it was previously limited to Chrome on Android or on ChromeOS, the
Network Information API is now available for Chrome on all platforms, though
meaningful values for
all of the properties
might not be available on every platform.
This code sample reflects the most recent implementation of the API, including
the connection.downlinkMax attribute, support for the
'wimax' connection type, and connection.onchange
event listener. (The older connection.ontypechange event listener
should no longer be used.)