News for hackers. Stuff that matters.
Re:Limiting JavaScript? by jefftk on Saturday February 02, 2019 @10:48PM (#19067724)
> What I know I care a lot about is when a tab I haven't looked at in three days is suddenly using CPU time _at all_. Just make it so background tabs get severely limited in their ability to do background execution and eventually get stopped entirely, and the problem is essentially solved.

Chrome does throttle background tabs: https://developers.google.com/web/updates/2017/03/background...

It doesn't throttle them all the way to zero, though. If they did that they'd break things like sites that change their favicon to signal "unread message".

(Disclosure: I work at Google, though not on Chrome)

Re:Limiting JavaScript? by tokyodude on Sunday February 03, 2019 @01:55AM (#19068217)
yes. without background processing every web based service that has live updates would break. Email (Gmail/outlook.com/...) chat (slack/messenger/WhatsApp/Discord) SNS (fb/Twitter) even stack overflow and github have various forms of live update
Re:Limiting JavaScript? by int_19h on Sunday February 03, 2019 @03:11AM (#19068401)
On mobile platforms, app don't use polling loops for that sort of stuff, precisely so that power usage could be optimized. Time for something similar for the web?
Re:Limiting JavaScript? by omnimus on Sunday February 03, 2019 @03:58AM (#19068513)
Arent notifications same thing with only difference that they go through apple/google centralized server so your phone doesnt have to listen for multiple servers but just one?
Re:Limiting JavaScript? by crooked-v on Sunday February 03, 2019 @04:49AM (#19068668)
A simple short-term workaround would a setInterval equivalent that can be set to "every so often" instead of a hard number, leaving it up to the browser or OS to coalesce updates into chunks of activity every so often.
Re:Limiting JavaScript? by ehavener on Sunday February 03, 2019 @06:27AM (#19069022)
background connections !== polling loops

Many services use an open tcp connection (e.g. websocket) rather than polling. Mobile platforms are doing the same thing, just on a system level. I guess service workers are the closest web analogue.

Re:Limiting JavaScript? by realusername on Sunday February 03, 2019 @12:13AM (#19068005)
Firefox has also the same logic to throttle background tabs.