KonradLinkowski / GeneticDrawer

image evolution algorithm
https://konradlinkowski.github.io/GeneticDrawer/
10 stars 10 forks source link

🚑 fix: Run in background #17

Closed ssghait007 closed 4 years ago

ssghait007 commented 4 years ago

Investigated issue #14 with iteration not working when tab is inactive, Browsers limit the setInterval and setTimeout to minimum time 1000 ms. Used below library to change setTimeout behavior, Now setTimeout uses web workers which are not limited in background. https://github.com/myonov/momentum

Inactive tabsRequires Gecko 5.0(Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)
Starting in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), intervals are clamped to fire no more often than once per second in inactive tabs.

reference: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval

ssghait007 commented 4 years ago

@KonradLinkowski I have also verified this fix on chrome, safari and firefox.