Wednesday, 4 May 2022

Web based Timer application using window.setInterval method in JavaScript does not work as expected on mobile browser (Chrome, Firefox etc.)

Web-based timer application using window.setInterval method in JavaScript does not work as expected in the mobile browser. The reason behind this is that after a certain time, the display goes off due to user inactivity and an application is moved to the background for power saving. Due to which window.setInterval does not trigger periodically and the entire calculation goes for a toss.

However, I have noticed that certain web-based timer works fine in the mobile browser despite these limitations. E.g. Google Timer. Despite the above limitation Google Timer works fine even in offline mode. What techniques are used by these applications so they work on mobile browser as well.



from Web based Timer application using window.setInterval method in JavaScript does not work as expected on mobile browser (Chrome, Firefox etc.)

No comments:

Post a Comment