What happens to setTimeout when the window is out of focus?
问题 I have a situation where I need to reauthenticate a token on a cordova app before the authentication token expires. To do that I figured I'd set a timeout just before the auth token expires, to reauthenticate. function authenticate() { var token = ... get token setTimeout(function() { .. try to reauthenticate }, token.expiresIn - 600*1000); } Problem I could see is that- The timeout period passes while the app is sleeping. Function does not fire? The timeout "countdown" (if that's how it