The Wake Lock API allows web applications to prevent the resource such as the screen, WiFi connection or CPU from becoming available as long as the application holds a lock for that resource. The purpose of the API is to let the user or the application to complete the activity uninterrupted.
At the moment there are two distinct technologies named Wake Lock API. One is a non-standard implementation available only on Firefox OS, while the second is a W3C proposal at the stage of initial drafts, with no vendor support yet.
lock = navigator.requestWakeLock('screen')
- Acquires a wake lock on the resource specified, such as
cpu(Firefox OS implementation).
- Releases the existing lock (Firefox OS implementation),
screen.keepAwake = true
- The property allowing to acquire a screen wake lock when set to
trueand release it when set to