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.screenEnabled

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

The MozPowerManager.screenEnabled property allows to know if the device's screen is currently enabled (true).

It also controls the device's screen, so setting it to false will turn off the screen.

Syntax

var isTheScreenEnabled = navigator.mozPower.screenEnabled

Value

Return a boolean.

Example

// If the screen is active
if (navigator.mozPower.screenEnabled) {
  // Let's shut it off
  navigator.mozPower.screenEnabled = false;
}

Specification

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,