Skip to content

Instantly share code, notes, and snippets.

@abinavseelan
Last active March 16, 2018 06:13
Show Gist options
  • Save abinavseelan/306a950a9eede5828af62aedffaa1421 to your computer and use it in GitHub Desktop.
Save abinavseelan/306a950a9eede5828af62aedffaa1421 to your computer and use it in GitHub Desktop.
(2) Page Visibility API
...
<body>
<script type="text/javascript">
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'hidden') {
document.title = '😴';
}
});
</script>
</body>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment