Live data from Hacker News

Show HN: Prevent your computer sleeping with just a webpage

nosleep.page

71–80 of 137 posts

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

#71
post #44
post #34

Why not just use keep awake? https://chrome.google.com/webstore/detail/keep-awake/bijihla...

I can think of a few reasons. Looking at that page, the extension seems to only be compatible with Crome OS. A pretty limited audience can use that. Also, I assume this is a pet project of the author. They had a need, and found a way to solve it. They probably had fun, and learned some things along the way. Often, that’s kind of the whole point of a weekend project. Even if there is another established solution, ‘Why…

It has worked on every OS that has chrome that I have used and takes like 30 seconds to install. It is easier to click a chrome extension to stay awake than go to a webpage in my opinion.

You do you though

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

#72

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?”

"This application prevented shutdown..."

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

#73
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'.

Or rather because the OS you're using doesn't think you're responsible enough to have that kind of control over your own computer.

edit: Ah, I misunderstood. This is for your highly locked down work computer.

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

#74
post #31

So i get annoyed that my computer doesn't go to sleep sometimes because some website is playing a video. Is there a simple way to tell Linux/Gnome/Chrome to ignore videos and go to sleep anyway? I don't watch long videos on this computer so I hate to come back into my office and find my screen never locked because some website played a video i wasn't even watching.

I think the best option would be an extension that disables autoplay across the board. There are many out there, though all flawed in their own way. The least worst for Chrome seems to be AutoplayStopper.

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

#75
post #45

So I like this and I'm trying it out, it seemingly works OK. However, the GREEN background is very annoying. I don't need the whole webpage to be green for me to know it's on and working. I can't minimize the browser (firefox) because then it apparently doesn't work. So I'm left with a very big green screen sitting in the corner of my eye. Wondering too the effect of that in terms of screen color burnout (if that's e…

> I can't minimize the browser (firefox) because then it apparently doesn't work. Can't you have a separate, tiny window?

MDN (linked from the page under discussion) says Firefox doesn't expose this API, so I feel like window configuration may be a side issue here.

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

#76

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…

The windows equivalent to this is an unsaved text file in notepad.

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

#77
post #46

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

If it's really locked down, you can find USB devices for a few bucks that emulate a mouse and move by a few pixels every minute. Foolproof for those companies with nonsensical settings or nonsensical spying.

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

#79

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…

The windows equivalent to this is an unsaved text file in notepad.

PowerToys[0] has a utility for that. It stays in the corner of the taskbar.

[0] https://github.com/microsoft/PowerToys

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

#80

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 have the opposite problem. I want it to restart overnight and come back to find it blocked by my terminal being open.

Incidentally iTerm will block a restart too, and is useful to have open all the time anyway!

Post reply on HN