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,