Tags: 1.0 2.0 2.5 Privileged


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
    A boolean indicating whether the wifi is on (true) or off (false).

  • WifiManager.macAddress
    A string representing the wifi adapter's MAC address.

  • WifiManager.connection
    An object providing information about the current connection (status and network in use).

  • WifiManager.connectionInformation
    An object providing extra information about the current connection or null if the device is not connected to the wifi.

  • WifiManager.openNetworkNotify
    Returns whether or not openNetworkNotify is currently enabled.

Event handlers

  • WifiManager.onenabled
    A handler for the enabled event; it is triggered when the wifi has been turned on.

  • WifiManager.ondisabled
    A handler for the disabled event; it is triggered when the wifi has been turned off.

  • WifiManager.onstatuschange
    A handler for the statuschange event; the event object is a MozWifiStatusChangeEvent instance.

  • WifiManager.onconnectioninfoupdate
    A handler for the connectioninfoupdate event; triggered any time the connection information changes. The event object is a MozWifiConnectionInfoEvent instance.

  • WifiManager.onopennetwork
    An event listener that is called with notification about the open wifi network available.


WifiManager by Mozilla Contributors is licensed under CC-BY-SA 2.5.