Summary:
The Screen Wake Lock API provides a way for websites to prevent devices from dimming or locking the screen. This is needed both to avoid web compat issues and to prevent websites from using more costly alternatives, like nosleep.js.
Bug: https://bugzil.la/1589554
Specification: https://www.w3.org/TR/screen-wake-lock/
Platform coverage: all
Preference: dom.screenwakelock.enabled, not landed yet
DevTools bug: n/a
Standards-positions discussion: https://github.com/mozilla/standards-positions/issues/210
Other browsers:
Blink: shipped since version 85, August 2020
WebKit: shipped since version 16.4, March 2023
Web-platform-tests:
Security & Privacy concerns: https://docs.google.com/document/d/1L2ppvkdLz-QVhZ_Fw6CV2ORgjKTlM8xATmPbCXVbCZo/edit?usp=sharing
Web designer / developer use-cases: https://www.w3.org/TR/wake-lock-use-cases/
Example: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API#examples