• 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. MozWakeLock
  6. MozWakeLock.unlock()

MozWakeLock.unlock()

In This Article
  1. Syntax
    1. Exceptions
  2. Example
  3. Specification
  4. See also

The MozWakeLock.unlock() method releases the lock on the resource. If several locks have been taken on the resource, each of them needs to be released individually.

Syntax

lock.unlock();

Exceptions

  • If the lock has already been unlocked, the NS_ERROR_DOM_INVALID_STATE_ERR is raised.

Example

var lock = window.navigator.requestWakeLock('screen');
... // do stuff
lock.unlock(); // unlock the screen resource

Specification

Not part of any specification

See also

  • Navigator.requestWakeLock()

Document Tags and Contributors

Tags: 
  • API
  • Firefox OS
  • Method
  • MozWakeLock
  • Non-standard
  • Reference
  • Wake Lock API
 Contributors to this page: chrisdavidmills, teoli
 Last updated by: chrisdavidmills, Feb 27, 2017, 2:09:17 AM
See also
  1. Archive