5

I will try to explain ours problem the simpliest possible way. We are facing a tricky bug with our web application + chrome.

We have a web page displaying curves, the refresh of the curve is triggered by a setTimeout. If the computer goes to sleep and then wake up it looks like the setTimeout is not restarting. We have to press our "real time" button to relaunch the setTimeout and then it restarts properly.

Is there a way to fix this issue and to make the refresh of the page active when waking up from sleep ?

Update: We have 6 Chrome instances that display different curves. All auto-refreshing. We leave it for the night. In the morning, waking the computer up from sleep mode and all windows are here, no freeze but no refresh anymore. We have to press our "real time" button on each screen to restart the refresh.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Arnaud
  • 141
  • 2
  • 9

1 Answers1

1

Check if the focus event of the whole window or document is triggered when computer comes back from sleep. If its triggered reset your timers from those handlers.

if (/*@cc_on!@*/false) { // check for Internet Explorer
    document.onfocusin = onFocus;
    document.onfocusout = onBlur;
} else {
    window.onfocus = onFocus;
    window.onblur = onBlur;
}
sabithpocker
  • 15,274
  • 1
  • 42
  • 75
  • In fact we are working with multi-screen solution. Our curves are displayed on 6 different screens therefore working with the "focus" concept won't work I guess. Thank's for your answer though. – Arnaud Dec 02 '14 at 10:27
  • Oh, in that case please add an example scenario from user perspective (with multiple screen). That might trigger some ideas in some seasoned brains. – sabithpocker Dec 02 '14 at 10:30
  • we have 6 Chrome instances that display different curves. All auto-refreshing. We leave it for the night. In the morning, waking the computer up from sleep mode and all windows are here, no freeze but no refresh anymore. We have to press our "real time" button on each screen to restart the refresh. – Arnaud Dec 02 '14 at 10:35