ContextCleaner: see every entry in the Windows 11 right-click menu, and which app added it — on the Microsoft Store.
Engineering StayGreen

Screen Wake Lock API Explained: How Websites Keep Your Screen On, and Why It Stops When You Switch Tabs

Published October 20, 2026 Updated October 23, 2026 8 min read

The Screen Wake Lock API lets a web page ask the browser to keep the screen from dimming, turning off or locking, which is how recipe sites, slide decks and ticket pages stay visible. The lock only lasts while that page is visible: switch tabs, minimize the window or hit low battery and the browser releases it, and the spec no longer offers a way for a page to keep the computer itself from sleeping. When you need the screen on for a Windows app, a browser window you keep switching away from, or a set amount of time, StayGreen from Automata Labs holds a documented Windows power request instead, with timed sessions, per-app rules and automatic release on battery and lock.

Keep the display on for exactly as long as you need, then let Windows sleep.

Get it from Microsoft

What is the Screen Wake Lock API?

It is a browser feature that a web page can call to keep the display awake. Mozilla’s MDN documentation describes it as “a way to prevent devices from dimming or locking the screen when an application needs to keep running,” and lists uses such as “reading an ebook, map navigation, following a recipe, presenting to an audience,” and scanning a QR code or barcode.

Some useful background:

  • It is a W3C specification. The Screen Wake Lock API is published by the W3C as a Working Draft, most recently dated 29 September 2026.
  • It is widely available. MDN marks it “Baseline 2025,” meaning it has worked across the latest browsers since March 2025.
  • Chrome added it first. Google’s developer article notes that it launched in Chrome 84.
  • It needs HTTPS. MDN says it is available only in secure contexts.

A page asks for the lock with navigator.wakeLock.request("screen") and gets back a sentinel object it can release later.

Why does the wake lock stop when I switch tabs?

Because the specification ties the lock to a visible page. Google’s article puts it plainly: “the screen wake lock is automatically released when you minimize a tab or window, or switch away from a tab or window where a screen wake lock is active.” MDN adds that “only active documents can acquire screen wake locks and previously acquired locks are automatically released when document becomes inactive.”

The W3C spec goes further and lists cases where the browser “may release a wake lock at any time,” including when it detects abnormal operation, when the “battery is considered low and discharging,” and when the user turns on a power-saving mode.

That is good design for a web page. It means a forgotten tab cannot hold your screen on all night. It is also why the API cannot solve every keep-awake problem.

EventWhat happens to a page’s screen wake lock
You stay on the tabThe lock holds, if the browser granted it
You switch to another tabReleased
You minimize the browser windowReleased
Battery is low and dischargingThe browser may release it
You turn on a power-saving modeThe browser may release it
The page is served over plain HTTPThe request is not available
The page is inside a third-party frameBlocked unless the site allows it

Pages that want the lock back must listen for the visibilitychange event and request a new one when you return. If the site does not do that, the screen can dim on the next idle timeout even though you are back on the page.

Can a website keep my computer from sleeping?

Not with this API. It has one lock type, screen. Google’s article explains that “an earlier version of the specification allowed an additional system wake lock that prevents the device’s CPU from entering standby mode,” and that “we aren’t proceeding with this type.” MDN suggests background fetch for long downloads and background sync for data sync instead.

So a web page can keep the display on while you watch it. It cannot keep a download, render or backup alive after you look away.

Can a website keep my screen on without asking?

The browser decides whether to grant a lock, and the spec builds in limits. MDN explains that access is controlled by the screen-wake-lock Permissions Policy, with a default allowlist of self. That lets the site’s own frames use it and “prevents third-party content from using locks” unless the site grants permission. MDN also recommends that pages “show some feedback on the interface to show if wake lock is active and a way for the user to disable it.”

If you suspect something is holding your screen on, the Windows command powercfg /requests lists current power requests. We cover how to read it in powercfg /requests: what keeps Windows awake.

When is the browser wake lock not enough?

The API fits “one page, on screen, in front of me.” These common situations fall outside it:

  1. You present from a desktop app, not a browser, and the app does not keep the screen awake itself.
  2. You read in one window and take notes in another. Switching windows releases the page’s lock.
  3. The site never asks for a lock. Most websites do not use the API at all.
  4. You need a long job to finish with the screen off. The web API has no system lock.
  5. You want a fixed amount of time, like 30 minutes for a call, then normal sleep.
  6. You are on a work PC where you cannot change the power plan.

How does StayGreen keep the screen on in Windows?

StayGreen uses the native route. According to its product page and Microsoft Store listing, it holds a documented Windows power request, built on the SetThreadExecutionState execution-state APIs, which is the same kind of mechanism a media player uses during playback. It does not simulate keyboard or mouse input by default, and it does not change your power plan.

What it adds on top:

  • Two modes. Display and system keeps the screen lit and blocks sleep. System only blocks sleep but lets the screen turn off, which covers the long-job case the web API dropped.
  • Timed sessions of 15, 30, 60 or 120 minutes, or any length up to 7 days, with a live countdown.
  • Per-app rules. Name the executables that matter, and StayGreen holds the display only while one of them is in the foreground. That can include your browser.
  • Automatic release on battery, when Battery Saver turns on, when you lock the PC, and when you close the lid with no external monitor.
  • An honest status readout that reports what Windows has actually granted, including the Modern Standby case where Windows ends keep-awake requests on battery.
  • No network access, no account and no telemetry.

That combination mirrors the good parts of the web API (it lets go on its own) without the tab-visibility limit. For the reasons a keep-awake request can still be overridden, see why Windows still sleeps with a keep-awake app.

Hold the screen on while your chosen app is in front, and release it the moment you switch.

Get it from Microsoft

Browser wake lock vs StayGreen

Screen Wake Lock APIStayGreen
Who turns it onThe website’s codeYou, or a per-app rule
Keeps the screen onYes, while the page is visibleYes, for the session or while a chosen app is in front
Keeps the PC awake with the screen offNoYes, in System only mode
Survives switching windowsNoYes, unless a per-app rule says otherwise
Works with desktop appsNoYes
Timed sessionsOnly if the site builds oneBuilt in, up to 7 days
Releases on low battery or power savingThe browser may release itReleases on battery and Battery Saver
CostFree, built into browsersOne-time purchase

Frequently asked questions

What does navigator.wakeLock do?

It lets a web page request a screen wake lock, which stops the display from dimming, turning off or locking while the page is visible.

Why does my recipe or slides site let the screen turn off?

Either the site does not request a wake lock, or the lock was released when you switched tabs or minimized and the site did not request it again.

Does the Screen Wake Lock API work in Edge, Chrome and Firefox?

MDN lists it as Baseline 2025, available across the latest major browsers. It requires HTTPS.

Can a website stop Windows from sleeping during a download?

Not through this API. The system wake lock was dropped from the spec. Keep the tab in front, or use a native tool in a system-only mode.

Does StayGreen keep Teams or Slack showing as available?

No. Its Store listing explains that those apps read keyboard and mouse activity, not whether the screen is on.

Try StayGreen

Get StayGreen from the Microsoft Store. It is a one-time purchase with no subscription, and the Store listing shows the current price.

Keep Windows awake on your terms, and let it sleep again on its own.

Get it from Microsoft

Microsoft, Windows, Edge and Teams are trademarks of the Microsoft group of companies. Chrome is a trademark of Google LLC. Firefox is a trademark of the Mozilla Foundation. Slack is a trademark of Slack Technologies, LLC. StayGreen is not affiliated with or endorsed by them or the W3C.

Last updated 20 October 2026. Published by Automata Labs, a software company in Canada.

// release_radar

Get notified about new releases.

We build native, local-first tools for professionals who refuse SaaS fatigue. Drop your email to hear about new apps, major updates, and zero-telemetry releases as they land on the Microsoft Store. No spam — just release news.