Open chrisbloom7 opened 11 years ago
I'll look into it soon.
Thanks. Here's a quick work around for anyone that needs it:
// Requires jQuery < 1.9, or https://github.com/gabceb/jquery-browser-plugin
function idlePause() {
// ...
};
function idleResume() {
// ...
};
function supportsIdleJs(){
// See: https://github.com/shawnmclean/Idle.js/issues/7
return !$.browser.msie || parseInt($.browser.version) > 8;
};
function supportsVisible(){
// Idle.js interprets page navigation in Firefox as being "away"
// See: https://github.com/shawnmclean/Idle.js/issues/9
return supportsIdleJs() && !$.browser.mozilla;
};
var idler = new Idle({
onAway: supportsIdleJs() ? idlePause : jQuery.noop,
onAwayBack: supportsIdleJs() ? idleResume : jQuery.noop,
onHidden: supportsVisible() ? idlePause : jQuery.noop,
onVisible: supportsVisible() ? idleResume : jQuery.noop,
awayTimeout: 5000,
});
If you go to http://shawnmclean.github.io/Idle.js/ in Firefox and refresh the page, you'll briefly see idle.js report that "User is not looking at page" before the page repaints. This is also happening in a dashboard app that I have whenever a user clicks on any link that takes them away from the dashboard - the "background polling paused" message I have setup is displayed for a second while Firefox is busy loading the new page.