Skip to content

Instantly share code, notes, and snippets.

@tosh
Created February 10, 2016 22:54
Show Gist options
  • Save tosh/24c17ace819fb56759f2 to your computer and use it in GitHub Desktop.
Save tosh/24c17ace819fb56759f2 to your computer and use it in GitHub Desktop.
invision style behavior of tab title change (see https://twitter.com/__tosh/status/697549109268500481)
document.addEventListener('visibilitychange', function(event) {
if (document.hidden) {
document.title = 'woohoo';
} else {
document.title = 'old title';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment