News for hackers. Stuff that matters.
Re:Show HN: Prevent your computer sleeping with just a webpage by gabrielsroka on Friday April 22, 2022 @12:56PM (#31124358)
Thanks for sharing this.

I've seen it on some recipe websites recently and was wondering how it worked.

I would recommend making the links (eg to the Mozilla page) use a different color or underlined.

Re:Show HN: Prevent your computer sleeping with just a webpage by Too on Saturday April 23, 2022 @01:39AM (#31131704)
While the use case for recipes stying alive is very useful. Should this responsibility really be delegated to each website?

I didn’t even know this was a feature of my browser. Say for example I write a shopping list based on the recipe web page, then go to the supermarket to buy the ingredients, leaving the tab open because I will need the instructions tomorrow for the cooking. Now my computer will be forced on during the rest of day based on the choice of the website owner?! Wtf. What if I leave the tablet open after finishing cooking, Is there any timeout on this thing or will that differ depending on each website?

Honestly this feature is really badly thought through. It should be a feature of the OS and not up to random web sites without even asking for permission.

Putting my most cynical hat on you could imagine advertisers enabling this on every website so you are more likely to be exposed to their ads.

Re:Show HN: Prevent your computer sleeping with just a webpage by bradleyjkemp on Friday April 22, 2022 @01:02PM (#31124472)
Yup, that's my bad CSS I'm afraid. https://bulma.io explicitly resets the color of <a> tags inside a hero, so I need to figure out how to stop/override that
Re:Show HN: Prevent your computer sleeping with just a webpage by pkage on Friday April 22, 2022 @01:32PM (#31125038)
The "bulma" way would be to add the `has-text-link` class to the <a> tag [0], which has the benefit of matching your styles as well.

[0] https://bulma.io/documentation/helpers/color-helpers/

Re:Show HN: Prevent your computer sleeping with just a webpage by bradleyjkemp on Friday April 22, 2022 @01:46PM (#31125306)
Ah neat, yeah that's exactly what I need, thanks!
Re:Show HN: Prevent your computer sleeping with just a webpage by gabrielsroka on Friday April 22, 2022 @01:12PM (#31124635)
One or the other or both of these

  <a href="https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API" style="text-decoration: underline; color: blue;">Screen Wake Lock API</a>