Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

MozPowerManager.addWakeLockListener()

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

The MozPowerManager.addWakeLockListener() method is used to register a handler to be called each time a resource changes its lock state.

Syntax

MozPowerManager.addWakeLockListener(handler);

Parameters

handler
It's a callback function that accepts two parameters: a string that contains the name of the resource and a string that figures the lock state for that resource (see getWakeLockState for more information about the various states).

Example

navigator.mozPower.addWakeLockListener(function (name, stat) {
  console.log("The lock state for the resource '" + name + "' is: " + stat);
});

Specifications

Not part of any specification.

See also

Document Tags and Contributors

 Contributors to this page: chrisdavidmills, teoli, MHasan, kscarfone, Sheppy, Jeremie
 Last updated by: chrisdavidmills,