Live data from Hacker News

Show HN: Prevent your computer sleeping with just a webpage

nosleep.page

61–70 of 137 posts

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

#61
Simple and potentially useful but I think that nosleep.js itself uses the Screen Wake Lock API when available, so maybe it's still overkill using it just as a fallback and writing other code on top of it.

Besides, it's a shame that iOS still doesn't support this API. The video-hack has too many drawbacks and this feature would be very useful for a certain kind of PWAs.

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

#63
post #46

This is awesome my work computer has a stupid 5 minute setting until it sleeps that is locked.

playing something in windows media player also keep it open, or running a powershell script that presses F13 or scroll lock also works.

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

#64
post #56

nosleep.js brings firefox from ~3% cpu usage to ~25-30% cpu usage. (it's playing an invisible video) that's a pretty steep cost to pay to simply keep a computer awake because the browser it's using doesn't support a 'stay-awake api'.

Indeed, how awful.

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

#65
Yeah, let's make it harder for the people who have to clean up after security incidents. The automatic logout policies are there for a reason. Bypassing that means one day, somebody's going to forget and leave an important workstation open for a passersby or malicious actor.

If it's that inconvenient, talk with your IT people and make a case for changing it. If you use stuff like this, I hope you get shitcanned.

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

#66

If you absolutely want to prevent a Mac from not only going to sleep, but restarting for any reason at all (say, to install important security updates, which are usually forced on the user with no choice), there aren't many good ways. The only thing I've found that really works reliably is to open MS Word, create a new document, add some random characters to it, and then leave without ever saving. Word will prevent t…

Same thing happens with JetBrains IDEs. I usually set my Mac to update after midnight but usually find it got stuck with the IDE asking “are you sure you want to quit?”

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

#67

If you absolutely want to prevent a Mac from not only going to sleep, but restarting for any reason at all (say, to install important security updates, which are usually forced on the user with no choice), there aren't many good ways. The only thing I've found that really works reliably is to open MS Word, create a new document, add some random characters to it, and then leave without ever saving. Word will prevent t…

Amphetamine[0] works pretty well for me. They also have an extension (a kext, I think) that gives it more reliability. I don't know how reliable it is without that extension though. [0]: https://apps.apple.com/us/app/amphetamine/id937984704?mt=12

I've been using the more bare-bones KeepingYouAwake[0] just because I came across Caffeine first and this was suggested as the continuation of that simple utility. The icon makes it obvious whether it is enabled or disabled

Edit: I see now that Amphetamine has the option of a similar-looking icon to make it more obvious whether it is enabled or not

[0] https://github.com/newmarcel/KeepingYouAwake

(My first HN comment, via Orion Browser)

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

#68

If you absolutely want to prevent a Mac from not only going to sleep, but restarting for any reason at all (say, to install important security updates, which are usually forced on the user with no choice), there aren't many good ways. The only thing I've found that really works reliably is to open MS Word, create a new document, add some random characters to it, and then leave without ever saving. Word will prevent t…

I’ve been using 10 hour videos of black screen with success.

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

#69

Yeah, let's make it harder for the people who have to clean up after security incidents. The automatic logout policies are there for a reason. Bypassing that means one day, somebody's going to forget and leave an important workstation open for a passersby or malicious actor. If it's that inconvenient, talk with your IT people and make a case for changing it. If you use stuff like this, I hope you get shitcanned.

Eh, I hear you and I understand the concern, but.. some very corporate jobs have very corporate ITs with their hands tied by policy that makes exceptions truly exceptional.

I was going to provide a more recent anecdote, but decided against since it was a little too specific.

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

#70
post #46

This is awesome my work computer has a stupid 5 minute setting until it sleeps that is locked.

Deliberately bypassing that puts your employment at risk. There's a reason you're being forced to log in.

If an employer is going to fire you for running caffeinate while presumably working from home (if you're leaving your laptop alone and unlocked in a public space God help you), maybe it's time to look for a new job :)
Post reply on HN