• Skip to main content
  • Select language
  • Skip to search
MDN Web Docs
  • Technologies
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs / DOM
    • WebExtensions
    • MathML
  • References & Guides
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
B2G OS
  1. MDN
  2. Archive of obsolete content
  3. B2G OS
  4. B2G OS APIs
  5. MozPowerManager
  6. MozPowerManager.screenBrightness

MozPowerManager.screenBrightness

In This Article
  1. Syntax
    1. Value
  2. Specification
  3. See also

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

The MozPowerManager.screenBrightness property defines the brightness of the screen's backlight, on a scale from 0 (very dim) to 1 (full brightness).

Setting this attribute modifies the screen's brightness. Values outside the range [0-1] are not allowed, and an error of type NS_ERROR_INVALID_ARG is thrown if such a value is assigned to that property.

This attribute can be read and written even when the screen is disabled, but the backlight is off while the screen is disabled.

If you write a value of X into this attribute, the attribute may not have the same value X when you later read it. Most screens don't support as many different brightness levels as there are doubles between 0 and 1, so the value's precision is reduced before storing it.

Syntax

var brightness = navigator.mozPower.screenBrightness

Value

Return a number in the range [0,1].

Specification

Not part of any specification.

See also

  • navigator.mozPower
  • PowerManager

Document Tags and Contributors

Tags: 
  • API
  • B2G
  • Firefox OS
  • Non Standard
  • Power Management
  • Property
  • Reference
  • Référence
 Contributors to this page: chrisdavidmills, teoli, MHasan, kscarfone, SarahWalrus, Sheppy, Jeremie
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:07:39 AM
See also
  1. Power Management API
  2. Archive
  3. Related pages for Power Management API
    1. PowerManager