DigitalClockBack to clock

Why Your Browser Has a 'Keep Screen On' Feature

A short explainer of the Wake Lock API — what it does, which browsers support it, and why we use it on DigitalClock.

June 27, 2026·3 min read

When you open DigitalClock and tap the sun icon, your laptop or phone will not dim or go to sleep for as long as the clock is on screen. We are not doing anything sneaky — we are just asking the browser nicely, using a standard API called Wake Lock.

What is the Wake Lock API

The Screen Wake Lock API is a web standard that lets a webpage request the operating system to keep the display turned on. Browsers expose a small JavaScript call:

await navigator.wakeLock.request("screen")

That returns a token. As long as the token is held, the OS will not dim or sleep the screen. When the page is closed, hidden, or you release the token, the OS goes back to its normal idle behavior.

Why does it exist

Before Wake Lock, websites that needed to stay visible — recipe readers, navigation pages, presentation slides, live scoreboards — either could not do anything (browser would dim and sleep after a minute or two) or had to play silent audio in a loop as a hack to fool the OS. Wake Lock is the official, permissioned, low-power way to do this.

Which browsers support it

  • Chrome / Edge / Brave / Opera: full support, on desktop and Android
  • Safari: supported on iOS 16.4+ and macOS Sonoma+
  • Firefox: supported on desktop since version 126, enabled by default

On unsupported browsers, DigitalClock simply does nothing — the toggle flips visually but the OS controls dimming as usual. We do not fall back to the silent audio trick.

Is it a privacy concern

No. Wake Lock is a request, not a permission. The browser does not ask you for consent because the API cannot reveal anything about you. It also automatically releases when the tab is hidden, so it cannot keep your screen on in the background. The moment you switch tabs or minimize the window, your device resumes normal sleep behavior.

How DigitalClock uses it

We request a wake lock when you toggle the sun icon, and release it when you toggle it off, when the tab becomes hidden, or when you close the page. Re-show the tab and we re-acquire the lock so you don't have to toggle it again.

Want to read more about the underlying API? Try the MDN Screen Wake Lock docs. Or just open DigitalClock and tap the sun icon to see it in action.