4 ms·
IIRC Safari achieves this by suspending the processes in background tabs, which could be running inefficient JavaScript (polling for new ads etc). There's no cr
by willtim 7y ago
IIRC Safari achieves this by suspending the processes in background tabs, which could be running inefficient JavaScript (polling for new ads etc). There's no cross-platform way to do this, but I think Mozilla absolutely need to try and find a way to address this. Web sites cannot be trusted to write efficient well-behaved JavaScript and so the burden of taming it falls upon the browser. There is probably some throttling going on, but clearly not enough. Running background JavaScript should be an opt-in permission, not the default.
- Vinnl 7y agoThere is an extension that does roughly this: https://addons.mozilla.org/en-US/firefox/addon/total-suspender/ https://addons.mozilla.org/en-US/firefox/addon/total-suspend... (Not to say that it wouldn't be good if Firefox was better at it, but for those using Firefox, it might still be interesting until then.)
- roca 7y agoFirefox can and does aggressively throttle JS in background tabs. However, it's not easy to do this in a way that doesn't break sites. Sometimes background tabs have JS doing actually useful work --- playing audio, running a simulation, receiving notifications, stuff like that. I don't know what Safari is doing differently to Firefox, and no doubt Firefox can improve here, but when people say "it's easy, just completely stop running JS in background tabs" they have no idea what tradeoffs that entails. (Just as when people said "browsers should just refuse to autoplay videos" had no idea what they were talking about.)
- chii 7y agoWhen people comments "it'd easy to..." or "just so XYZ, it's simple", it means they haven't actually done the work before, and is just sprouting bs.
- mantap 7y agoThe answer is simply that yes Safari breaks websites, but users are happy to make that tradeoff. It's common knowledge among web developers that browsers aggressively throttle background tabs so anybody who is designing a website that depends on it is misguided. I don't hear anybody complaining about Safari being too aggressive with background tabs, I do hear people complaining that Firefox uses too much battery. So I think Firefox should be more aggressive.
- plopz 7y agoHaven't people been complaining that youtube will randomly stop playing in the background on safari? I'm not so sure users are happy about that as you say.
- mantap 7y agoThat sounds simple to fix by checking whether the tab is playing audio.
- roca 7y agoA poll of your friends may not constitute adequate data for making such decisions. We know for sure that techie-people and friends-of-techie-people are qualitatively different to the mass market. These tradeoffs may also be different for different browsers. E.g. if you're Apple, perhaps breaking Web sites isn't a big deal since on iOS Safari is entrenched by fiat, and if users switch from Web apps to native apps, so much the better for Apple. For Mozilla that calculation works out differently. Generally speaking "site X breaks in Firefox, works in Chrome" is a good way for Mozilla to lose market share.