What Is the Screen Wake Lock API? A Plain Explanation
The Screen Wake Lock API lets a web page ask the browser to keep the screen from turning off. It needs HTTPS, works in current Chrome, Edge, Firefox and Safari, and is released automatically when the page becomes hidden. The browser can also refuse it, for example on low battery.

How it works
A page calls navigator.wakeLock.request("screen"). If the browser agrees, the screen stays on until the page releases the lock or the browser does. MDN notes that the API is only available in secure contexts (HTTPS) and can be limited by the Permissions-Policy screen-wake-lock.
When it stops
- Hidden page: MDN says the lock is released when the document becomes inactive or hidden. A page can request again when it turns visible.
- System reasons: Requests can be rejected for system reasons such as power-save mode or low battery, and the system can release the lock for low battery.
- Manual release: The page can release it, and the browser fires a
releaseevent either way.
Support
Can I use reports roughly 96% global usage coverage. MDN calls it Baseline 2025 (newly available), working across latest devices and browsers since March 2025.
What it can’t do
It does not keep the machine awake with the lid closed, keep a background tab alive, or change your OS settings. That is why our guides point to OS settings for those jobs.
A minimal example
This is roughly what our tool does, without the timers and the interface:
let lock = null;
async function keepAwake() {
try {
lock = await navigator.wakeLock.request('screen');
lock.addEventListener('release', () => console.log('released'));
} catch (err) {
console.log('refused:', err.name);
}
}
document.addEventListener('visibilitychange', () => {
if (lock !== null && document.visibilityState === 'visible') keepAwake();
});
The visibilitychange handler matters. The browser releases the lock when the tab is hidden, so a page that wants to keep the screen on must request it again when it becomes visible.
Requirements
- HTTPS: the API only works in a secure context, so
https://pages andlocalhost. - A visible page: hidden tabs cannot hold or request a lock.
- Permissions policy: a page in an iframe needs the
screen-wake-lockpermission from its parent. - Battery and power saving: the browser or system can refuse the request, for example in battery saver, so always handle the error.
What it is used for
Recipe sites, slideshow and presentation tools, sheet music, navigation, fitness timers, QR boarding passes and dashboards all use it. Before the API existed, sites played a silent looping video to stop the screen sleeping, which used far more power.
Frequently asked questions
Does it keep the whole computer awake?
No. The 'screen' lock is the only type; Chrome's docs note the 'system' type was dropped from the spec.
Which browsers support it?
Can I use lists Chrome and Edge 84+, Firefox 126+, Safari and iOS Safari 16.4+, and Samsung Internet 14+. MDN calls it Baseline 2025.
Why did it stop working?
The lock is released when you switch tab, minimise, or lock the device. A page must request it again when visible.
Sources
- MDN: Screen Wake Lock API
- Chrome for Developers: Stay awake with the Screen Wake Lock API
- Can I use: Screen Wake Lock API
Written by Maurice Rana. Last verified against the sources above.