How the Screen Wake Lock API Works
A practical explanation of the browser API that lets sites request a screen stay on.
The Screen Wake Lock API gives a web page a way to ask the device to keep its screen on. It is useful for pages people need to keep visible, such as a recipe, presentation, map, or monitoring dashboard. The request is temporary: the browser and operating system remain in control.
What a screen wake lock changes
A screen wake lock is about the display. It does not simulate a keyboard, move a mouse, change a computer’s power plan, or promise that every background process will keep running. The device can refuse a request or release it when conditions change. The page should reflect that state instead of claiming the screen is guaranteed to stay on.
Visibility matters
Browsers generally release a screen wake lock when a page is no longer visible. A well-behaved app listens for visibility changes and requests a new lock after the user returns to the page. The request can still fail, for example because of a device policy or low-power condition.
Browser support and permissions
The API requires a secure context on supported browsers. Older browsers may not implement it. Rather than implying the feature works everywhere, a site should detect support and explain when a request is unavailable. Starting a lock in response to a clear user action also makes the experience understandable.
How to use it responsibly
Use the API when you have a real reason to keep visible content on screen. End the session when finished, especially on battery-powered devices. For overnight or unattended work, operating system power settings and the task’s own application are more appropriate than relying on a web page.