vitling/acid-banger

Clock slows down significantly and randomizer stops in Safari

jorgeselva opened this issue · 2 comments

Navigating away from the playback interface as the main tab in Safari causes a significant drop in the clock and the randomizer also stops. Everything functions normally when the app is the active tab and reverts back to functioning normally if you move away and click back. Only happens in Safari and functions perfectly in Chrome.

Safari version 14.0.3 (16610.4.3.1.7)

The behaviour of timers when the browser is not in focus and/or not being actively used is an implementation detail which is up to the browser. Many browsers will throttle timers to fire less often when a page is in the background, to limit the ability for cpu-intensive web pages to slow down your computer.

I believe this to be "as intended" on the part of the browser developers, and as such there's not much to do about it from the perspective of web-based app. My guess is that Chrome makes different decisions about when to throttle timers than Safari, which is why it might keep playing when Safari doesn't.

Thanks for the explanation @vitling – makes sense that it's due to Safari throttling and not something that be can be addressed through the app.

Amazing work on this by the way!