Live data from Hacker News

Show HN: Prevent your computer sleeping with just a webpage

nosleep.page

1–10 of 137 posts

Show HN: Prevent your computer sleeping with just a webpage

#1
There's often times I want to prevent a computer/laptop/VM from sleeping and while, yes, there's various Caffeine/Amphetamine apps they're often overkill.

Instead, this small (12Kb) page does the job and only needs a web browser.

It's just a very simple usage of a web api normally used for things like video players: https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake...

Show HN: Prevent your computer sleeping with just a webpage
nosleep.page

Re: Show HN: Prevent your computer sleeping with just a webpage

#2
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?

Re: Show HN: Prevent your computer sleeping with just a webpage

#3
As Firefox (& I think Safari too) does not support the ScreenWakeLock API are you using NoSleep.js? https://github.com/richtr/NoSleep.js

This library implements a hack and plays a very tiny video in a loop too. This should even work on mobile devices and (according to my personal&tiny tests) is not that inefficient as it sounds :)

Re: Show HN: Prevent your computer sleeping with just a webpage

#4

As Firefox (& I think Safari too) does not support the ScreenWakeLock API are you using NoSleep.js? https://github.com/richtr/NoSleep.js This library implements a hack and plays a very tiny video in a loop too. This should even work on mobile devices and (according to my personal&tiny tests) is not that inefficient as it sounds :)

Are we seeing different sites when you click on the link? Because that is literally all the landing page says.

  This tiny site uses the Screen Wake Lock API to prevent your device from sleeping.
  
  Where this API isn't supported, an empty silent video is played to emulate this behaviour (using NoSleep.js).

Re: Show HN: Prevent your computer sleeping with just a webpage

#5

As Firefox (& I think Safari too) does not support the ScreenWakeLock API are you using NoSleep.js? https://github.com/richtr/NoSleep.js This library implements a hack and plays a very tiny video in a loop too. This should even work on mobile devices and (according to my personal&tiny tests) is not that inefficient as it sounds :)

[deleted]

Re: Show HN: Prevent your computer sleeping with just a webpage

#6
post #4

As Firefox (& I think Safari too) does not support the ScreenWakeLock API are you using NoSleep.js? https://github.com/richtr/NoSleep.js This library implements a hack and plays a very tiny video in a loop too. This should even work on mobile devices and (according to my personal&tiny tests) is not that inefficient as it sounds :)

Are we seeing different sites when you click on the link? Because that is literally all the landing page says. This tiny site uses the Screen Wake Lock API to prevent your device from sleeping. Where this API isn't supported, an empty silent video is played to emulate this behaviour (using NoSleep.js).

I obviously missed the NoSleep.js at the end ... but then I wonder: what is then so special about this website?

Re: Show HN: Prevent your computer sleeping with just a webpage

#8
post #4

Earlier quoted context omitted.

Are we seeing different sites when you click on the link? Because that is literally all the landing page says. This tiny site uses the Screen Wake Lock API to prevent your device from sleeping. Where this API isn't supported, an empty silent video is played to emulate this behaviour (using NoSleep.js).

I obviously missed the NoSleep.js at the end ... but then I wonder: what is then so special about this website?

The idea. A lot of company computers have autolock on, just an example.

Re: Show HN: Prevent your computer sleeping with just a webpage

#9
post #4

Earlier quoted context omitted.

Are we seeing different sites when you click on the link? Because that is literally all the landing page says. This tiny site uses the Screen Wake Lock API to prevent your device from sleeping. Where this API isn't supported, an empty silent video is played to emulate this behaviour (using NoSleep.js).

I obviously missed the NoSleep.js at the end ... but then I wonder: what is then so special about this website?

It prevents your computer from sleeping with just a webpage. Why does it need to be more special than that?
Post reply on HN