This API is available on Firefox OS for internal applications only.


The WifiManager API provides access to the wifi device capability.


interface WifiManager {
  readonly attribute boolean enabled;
  readonly attribute string macAddress;
  readonly attribute object connection;
  readonly attribute object connectionInformation;
  attribute nsIDOMEventListener onenabled;
  attribute nsIDOMEventListener ondisabled;
  attribute nsIDOMEventListener onstatuschange;
  attribute nsIDOMEventListener onconnectioninfoupdate;
  attribute nsIDOMEventListener onstationinfoupdate
  DOMRequest getNetworks();
  DOMRequest getKnownNetworks();
  DOMRequest associate(object network);
  DOMRequest forget(object network);
  DOMRequest wps(object detail);
  DOMRequest setPowerSavingMode(boolean enabled);
  DOMRequest setStaticIpMode(object network, object info)


WifiManager.enabled Read only
A boolean indicating whether the wifi is on (true) or off (false).
WifiManager.macAddress Read only
A string representing the wifi adapter's MAC address.
WifiManager.connection Read only
An object providing information about the current connection (status and network in use).
WifiManager.connectionInformation Read only
An object providing extra information about the current connection or null if the device is not connected to the wifi.

Event handlers

A handler for the enabled event; it is triggered when the wifi has been turned on.
A handler for the disabled event; it is triggered when the wifi has been turned off.
A handler for the statuschange event; the event object is a MozWifiStatusChangeEvent instance.
WifiManager.connectionInfoUpdate Requires Firefox OS 1.4 or below
WifiManager.onconnectionInfoUpdate Requires Firefox OS 2.0 or below
WifiManager.onconnectioninfoupdate Requires Firefox OS 2.1
A handler for the connectioninfoupdate event; triggered any time the connection information changes. The event object is a MozWifiConnectionInfoEvent instance.
WifiManager.onstationInfoUpdate Requires Firefox OS 2.0
WifiManager.onstationinfoupdate Requires Firefox OS 2.1


Allows to associate (and connect) a device with a given network. Returns a DOMRequest.
Allows to make a device no longer associate with a given network. Returns a DOMRequest.
Allows to retrieve the list of all the networks the device was associated with. Returns a DOMRequest.
Allows to retrieve the list of all the networks available in the area surrounding the device. Returns a DOMRequest.
Allows the wifi adapter to enter/exit power saving mode. Returns a DOMRequest.
Allows to configure a static IP address for the device on a given network. Returns a DOMRequest.
Allows to connect the device to a network using the network's WPS capability (if any). Returns a DOMRequest.


Not part of any specification

See also

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, teoli, mbeijen, Jeremie, kscarfone, dbruant
 Last updated by: chrisdavidmills,