changeIcon.js is a small favicon and title changer library that uses event emitters
changeIcon.addAction("initial" ,"Welcome!" ,"favicon.ico");
// Emit the action anytime you want
changeIcon.emitAction("initial");
You can emit "added actions" as much as you want
Changes the icon and title when user switches to another page
changeIcon.onAnotherTab("Noooo!" ,"crying.ico");
Executes the callback when user turns to the page
changeIcon.addAction("initial","WelcomeBack!","smiling.ico");
changeIcon.onThisTab(() => {
changeIcon.emitAction("initial");
});
That one is a special emitter that turns the title and the icon to their original state
changeIcon.js is released under the MIT license.