Connection.bandwidth

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

The Connection.bandwidth read-only property is a double representing the estimated download bandwidth (in megabytes per second) of the current connection.

Syntax

JavaScript
speed = connection.bandwidth

On return, speed is the estimated download bandwidth in megabytes per second. There are two special values: 0 is returned if the user is currently offline, and infinity is returned if the bandwidth is unknown.

Specifications

Specification Status Comment
Network Information API
The definition of 'Connection.bandwidth' in that specification.
Editor's Draft Initial specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported 12.0 moz Not supported Not supported Not supported
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported 12.0 moz Not supported Not supported Not supported

Gecko notes

  • The Network API can be disabled using the dom.network.enabled preference.
  • As of Gecko 12.0, the Network API is implemented for Android systems only. Support for Linux (bug 712442) and Windows (bug 721306) systems is in progress.

See also

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/connection/bandwidth

API Connection Experimental NeedsExample Network Information API Property Reference