Last active
November 29, 2017 22:47
-
-
Save sillyslux/1ed6981e1d284d216e9e36a833ef5425 to your computer and use it in GitHub Desktop.
funny ping hack for browser tabs
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
<script> | |
window.addEventListener('storage',evt=>evt.key==='pingAll'&&console.log("got pinged")) | |
window.addEventListener('focus',()=>localStorage.setItem('pingAll',Date.now())||console.log("ping")) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment