Created
May 15, 2019 22:40
-
-
Save rmariuzzo/204d299593dbd40920c545017689de7b to your computer and use it in GitHub Desktop.
Refresh a web page when no mouse activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DO NOT COMMIT | |
(() => { | |
const keepAwake = () => { | |
clearTimeout(keepAwake.nod.timeoutId) | |
keepAwake.nod() | |
} | |
keepAwake.nod = () => { | |
keepAwake.nod.timeoutId = setTimeout(() => { | |
location.reload() | |
keepAwake.nod() | |
}, 1e3 * 60 * 15) | |
} | |
document.addEventListener('mousemove', keepAwake) | |
keepAwake.nod() | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment