Skip to content

Instantly share code, notes, and snippets.

@sillyslux
Last active November 29, 2017 22:47
Show Gist options
  • Save sillyslux/1ed6981e1d284d216e9e36a833ef5425 to your computer and use it in GitHub Desktop.
Save sillyslux/1ed6981e1d284d216e9e36a833ef5425 to your computer and use it in GitHub Desktop.
funny ping hack for browser tabs
<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