Re:Show HN: Prevent your computer sleeping with just a webpage
by justusthane on Friday April 22, 2022 @12:38PM
(#31124006)
This looks cool! It would be nice if there was a little more info on the page about how it works and any potential limitations. For example, does the page have to remain in the foreground? And if it does work in the background, will it still work if the browser unloads the page from memory?
[ Parent
| on HN ]
Re:Show HN: Prevent your computer sleeping with just a webpage
by bradleyjkemp on Friday April 22, 2022 @01:08PM
(#31124582)
Oh, 100% I need some more docs on the page: it's definitely not foolproof.
From my testing, it works even if the window is in the background somewhere but generally it stops working if you switch to a different tab within the same window.
You should get a popup though if you do something that causes the page to lose its Wake Lock (which works by listening to the release event: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake...)