Browser APIs pertaining to the underlying network the browser is running on.
Kind: global class
object
function
boolean
Check whether the browser supports networking queries.
Kind: instance method of NetworkAPI
Returns: boolean
- True if network APIs are supported.
WiFiStatus
Create an object holding the default WiFi status metrics.
Kind: instance method of NetworkAPI
Returns: WiFiStatus
- The default WiFi status.
Add an observer to be notified when the browser’s WiFi status has changed. The provided callback is triggered immediately with the browser’s current WiFi status (if it has one).
Kind: instance method of NetworkAPI
Param | Type | Default | Description |
---|---|---|---|
observer | WifiStatusChangedCallback |
Callback triggered when the browser’s WiFi status has changed. | |
[notifyAll] | boolean |
false |
Whether to be notified of all WiFi networks discovered by the browser, or only the currently connected WiFi network. |
Request the browser for an updated WiFi status. When results are available, all registered observers will be notified.
Kind: instance method of NetworkAPI
object
An object containing metrics about a WiFi network the browser has discovered. If the system the browser is running on does not support all metrics, they will be 0 (signalLevel) or -1 (rxMbps / txMbps).
Kind: static typedef of NetworkAPI
See
Properties
Name | Type | Description |
---|---|---|
ssid | string |
The service set identifier (SSID) of the WiFi network. |
bssid | string |
The basic service set identifier (BSSID) of the WiFi access point. |
connectionState | string |
The WiFi network’s current connection state (one of “Connected”, “Connecting”, “NotConnected”). |
rssi | number |
The received signal strength indicator of the network, in dBm. Will typically be on a scale of -100 (worst strength) to 0 (best strength). |
signalLevel | number |
The RSSI signal quality rating using the system’s RSSI quality rating thresholds. Will typically be on a scale of 0 (worst strength) to maxSignalLevel (best strength). |
maxSignalLevel | number |
The system’s maximum signal level. |
frequency | number |
The network channel’s band, in MHz. |
linkSpeed | number |
The current link speed, in Mbps. |
rxMbps | number |
The current receive link speed, in Mbps. |
txMbps | number |
The current transmit link speed, in Mbps. |
maxRxMbps | number |
The maximum supported receive link speed, in Mbps. |
maxTxMbps | number |
The maximum supported transmit link speed, in Mbps. |
noiseMeasurement | number |
The current aggregate noise measurement for the network, in dBm. |
function
Callback triggered when browser’s WiFi status has changed.
The parameter provided to the callback depends on how the callback was registered. If requested to be notified about all networks, then the provided parameter will be a list of all WiFi networks discovered by the browser. Otherwise, it will be the currently connected WiFi network (if there is one).
Kind: static typedef of NetworkAPI
Param | Type | Description |
---|---|---|
status | Array.<WiFiStatus> | WiFiStatus |
A list of all discovered WiFi networks, or the currently connected WiFi network. |