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.