This is an archived page. It's not actively maintained.


Kein Standard
Diese Funktion entspricht nicht dem Standard und ist nicht Teil der Standardisierung. Diese Funktion darf nicht in Webseiten, die via das Internet zug├Ąnglich sind, benutzt werden: Sie wird nicht f├╝r alle Nutzer funktionieren. Es kann zu umfangreichen Inkompatibilit├Ąten zwischen verschiedenen Implementierungen kommen und die Funktionsweise oder Eigenschaften k├Ânnten in der Zukunft ver├Ąndert werden.

This Navigator.requestWakeLock() method of the Wake Lock API is used to request a MozWakeLock on any resource of the device. This means that you can prevent that resource from becoming unavailable as long as your app holds a lock for that resource. For example, a voice recording app can obtain a lock to keep the screen on during recording so that it can give prover visual feedback to the user that recording is progressing.

Note: When the window that requested one or more wake locks is closed or destroyed, any wake locks it acquired are implicitly released; no manual release is necessary.


lock = window.navigator.requestWakeLock(resourceName);


A string representing the name of the resource to lock. Gaia uses four basic resources names: screen, cpuwifi, and gps, but any certified application can expose new resources.

Return value

Returns a MozWakeLock object you can use to keep track of or release the lock..


W3C tracks Wake Lock: Use cases and is working on the Editor's traft API.

See also