0

Chrome apparently stops updating a page when you go idle (i.e. when the screen saver comes up).

My problem is I've written an alarm app, and it doesn't work because the Javascript stops running when the computer goes idle. Is there any way around this?


Update: After testing a few different things, it seems that Chrome doesn't stop updating a page, it just stops rendering it. So for my problem (an alarm app), this is solved.

felwithe
  • 2,683
  • 2
  • 23
  • 38
  • We'd know much more if you would add some code, but a lot of sites that make things like this rely on flash. – Marko Mackic Jul 27 '16 at 17:03
  • @MarkoMackic That's not relevant. Whatever it is, it will stop running when the computer goes idle/when Chrome has decided you're idle. – felwithe Jul 27 '16 at 17:06
  • http://stackoverflow.com/questions/5927284/how-can-i-make-setinterval-also-work-when-a-tab-is-inactive-in-chrome read this, try with web worker :) – Marko Mackic Jul 27 '16 at 17:15
  • probably the a possible soln revolves around webworkers and nosleepjs https://github.com/richtr/NoSleep.js – Iceman Jul 27 '16 at 17:24
  • *"for my problem (an alarm app), this is solved"* Please post an answer. – Borodin Jul 19 '18 at 16:36

1 Answers1

0

Are you using requestAnimationFrame? I know Chrome explicitly pauses those callbacks, but it may not also pause setTimeout.

probablyup
  • 7,636
  • 1
  • 27
  • 40