The Wake Lock API allows web applications to prevent the resource such as the screen or system from becoming unavailable 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 ongoing long activity - like navigation or reading - uninterrupted.
The only available implementation, available behind an "Experimental Web Platform Features" flag in Google Chrome on desktop, is just a boolean flag controllable by the application, based on the previous version of the specification. It is now considered too open for abuse and is lacking user consent, so the recent specification draft (published June 2017) proposes more explicit approach. It is not implemented by any vendor, yet.
- Requests a wake lock managing object on the resource specified, such as
system. Returns a
Promisewith the lock managing object.
lockRequest = lock.createRequest()
- Activates the wake lock on the previously acquired managing object.
- Releases the existing lock.
screen.keepAwake = true
- The property allowing to acquire a screen wake lock when set to
trueand release it when set to