Skip to content

Instantly share code, notes, and snippets.

@yuanchuan
Created July 23, 2014 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuanchuan/ca5aa61ce9894b4fb473 to your computer and use it in GitHub Desktop.
Save yuanchuan/ca5aa61ce9894b4fb473 to your computer and use it in GitHub Desktop.
set title
var notify = (function() {
var origin = document.title.replace(/^\(\d\)?/, '');
var pattern = '(*) ';
return {
clear: function() {
document.title = origin;
},
count: function(n) {
document.title = pattern.replace('*', n) + origin;
}
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment