The Screen Wake Lock API is designed for situations where a display should remain visible, such as reading or presenting. A site can request a lock while visible, then must request it again after the page returns to the foreground. The browser or device can deny or revoke that request, so check the active indicator before relying on it.
Start with the browser tab
The screen wake lock is designed for visible pages. Start it with the session button and keep the page open; if you return after switching away, check whether the lock is still active.
Why a request may end
The browser can release a lock when the page is hidden or no longer active, and can deny or release it for device-specific reasons. A timer is not a guarantee.
For the underlying browser behavior, see the W3C Screen Wake Lock specification.