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

MozPowerManager.getWakeLockState()

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

The MozPowerManager.getWakeLockState() method is used to retrieve the current lock state of a given resource.

Syntax

MozPowerManager.getWakeLockState(resourceName);

Parameters

resourceName
A string that represent the name of the resource to check.

Return value

This method will return a string that represents the current lock state for the resource. Possible values for this state are:

unlocked
Nobody holds the wake lock.
locked-foreground
At least one window holds the wake lock and is visible.
locked-background
At least one window holds the wake lock, but all of them are hidden.

Example

var state = navigator.mozPower.getWakeLockState('screen')

console.log('screen: ' + state);

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,