MozPowerManager.screenEnabled

Non-standard
This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

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: teoli, MHasan, kscarfone, Sheppy, Jeremie
Last updated by: teoli,