Answer the question
In order to leave comments, you need to log in
Why does the countdown timer slow down if the site tab is not active?
Hello everyone I
installed such a countdown on the site , but I noticed that if you open another tab of another site (do not close the tab of my site) and after 30 seconds open my tab, then the timer is not -30 seconds, from the value before switching to another tab , but much less. As far as I understand, the script freezes and when the tab in the browser is not active, it simply does not work. How can this be corrected?
Answer the question
In order to leave comments, you need to log in
Do you think it is correct that you occupy the user's resources for what he does not see ?
Lately, browsers have been limiting such things - both to save electricity in smartphones, and to avoid "miners in the browser", etc.
How to solve?
Update to the current time when the tab is activated.
And according to the mind - also stop when leaving the tab.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question