Live data from Hacker News

Chrome will aggressively throttle background tabs

blog.strml.net

131–140 of 403 posts

Re: Chrome will aggressively throttle background tabs

#131

What are we supposed to do about stuff this? Like I wrote a video game https://play.basketball-gm.com/ that lets you open multiple tabs for viewing multiple screens even while simulation is occurring in another tab. But Chrome recently stopped running the simulation if it's in a background tab. Putting my simulation code in a Shared Worker would be nice, except Safari and IE will never support it and it seems likely…

It would be dodgy hack, but another HN comment made reference to a statement that tabs playing audio are always considered "foregrounded": https://groups.google.com/a/chromium.org/forum/#!topic/blink...

...that would explain why flash files with no sound seem to 'pause' (or at least, run very, very slowly) when in a different tab.

Re: Chrome will aggressively throttle background tabs

#132
post #20

I like the change as a general idea but there obviously needs to be a manual override. Like, I don't want websites to access my camera without permission but obviously I want to allow some websites to do that. A similar permission could be used here and is perfectly backwards compatible: 1. a tab exceeds its quota and throttling kicks in; 2. you visit the tab to check why it stopped working; 3. you get a permission p…

>3. I swear to god if I see anything mentioning a battery on a desktop machine with no battery...

There's no way to know whether or not it has a battery. Maybe it's on a UPS, for example.

All I know is that my desktop runs at about 70W idle vs. 450W fully-loaded. Unnecessary use of the CPU wastes money regardless of whether or not you're using that money to charge a battery.

Re: Chrome will aggressively throttle background tabs

#133

It's awesome to see Chrome trying to improve performance for people with many tabs open, which is many of us. I use a LOT of tabs, and the best plugin has been The Great Suspender. Highly recommend it for anyone who wants memory & CPU back and keeps many tabs/windows open at once: https://chrome.google.com/webstore/detail/the-great-suspende...

I meet many tab hoarders (always open a new one, never close any, ending up with hundrets), but just can't wrap my head around it! I hate having more than 6-7 simultaneously open because it gets increasingly harder to keep an overview of what you're doing. The same applies for IDE tabs or windows. Too much of them and finding the right one becomes increasingly hard, and losing the thread more likely.

I use my tabs as a task list. I close them once I have read the page, taken action on the knowledge in the page or decided it was too stale to matter anymore.

Re: Chrome will aggressively throttle background tabs

#136

Earlier quoted context omitted.

Pinned tabs would be an easy solution for this. "Don't throttle pinned tabs"

A common use-case is tabs that are streaming music. I'm not sure if most users are even aware of pinned tabs.

It still drives me nuts there's no keyboard shortcut for it. `Command + Shift + P` would be sweeeeeeet.

Re: Chrome will aggressively throttle background tabs

#137
post #116
post #101

Earlier quoted context omitted.

Oh, it's awful, I agree. This is the nicest layout but the JS is terrible. I've reverted to a plain-HTML layout.

To whoever downvoted this: I am the author of the post above, and in response I've removed the JS-centric layout.

could have been a fat finger someone had on the button. i upvoted you to help.

Re: Chrome will aggressively throttle background tabs

#138
post #88

Earlier quoted context omitted.

It is a pure SPA, you just have the option of opening multiple instances at the same time. Like I can open gmail in two tabs, but it's still an SPA. And yeah tabs in JS are possible and I might go down that route, it'll just be a lot of extra work to replicate a UI that already exists fine.

Here's an example: http://orteil.dashnet.org/cookieclicker/ Opening another tab creates a new bakery, not a view into the same bakery. (This only works if you haven't played before or clear your cookies.) Edit: If you really want to keep the same functionality then you would need to bring server communication into the mix. It's possible to either run the simulation server-side, or at least communicate the state betwe…

The point still being, with this change you can have only one tab doing server communication at "full throttle", which may kill whatever gameplay elements make the players open this game in multiple tabs.

Re: Chrome will aggressively throttle background tabs

#139

What are we supposed to do about stuff this? Like I wrote a video game https://play.basketball-gm.com/ that lets you open multiple tabs for viewing multiple screens even while simulation is occurring in another tab. But Chrome recently stopped running the simulation if it's in a background tab. Putting my simulation code in a Shared Worker would be nice, except Safari and IE will never support it and it seems likely…

As a developer you need to decide whether or not to support a browser, and if that browser doesn't provide the APIs you need then you should drop support for that feature in that browser. In this case, if Chrome is making a change that you can't or won't change your game for then the solution is to detect Chrome and display a "This game only works in a single tab in Chrome. Try Firefox!" message if a user opens it in…

It's your customers that generally dictate what browser you support.

Re: Chrome will aggressively throttle background tabs

#140
post #11

Earlier quoted context omitted.

Yes? I mean, you have to admit what you built is the epitome of edge case when it comes to how a browser is typically used, and is actually exactly the type of thing they want to optimize because basically if you aren't looking at the tab, it's not being used (generally). Maybe use electron or something?

I don't think that replacing a traditional desktop app with a web app is an edge case. That's one of the main points of HTML5.

I think what was meant by edge case is how you've architected this. Going by a statement in another comment of yours:

> It is a pure SPA, you just have the option of opening multiple instances at the same time. Like I can open gmail in two tabs, but it's still an SPA.

Gmail just runs the UI in the browser though, the actual work of processing, receiving and sending mail is not done in a tab. The tabs are just views into the system.

It sounds like you are having one tab as both the client and the server, and separate tabs as clients to that other tab, which is pretty edge case.

As someone else suggested, you could move the processing to the server, but I imagine that's not feasible because then you are centralizing the processing and you're paying for processing, not the people visiting.

The more appropriate way to architect this (to my eyes, so take it for whatever you think it's worth) would be to use JS to manage tabs within the application (which you mentioned elsewhere already). The really simple way to implement this might be to have the JS tabs just contain an iframe to the prior implementation's real separate tab URL (since it already works that way, there's not likely to be any security issues you have to deal with).

Post reply on HN