Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.08 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.08 KB

Welcome to changeIcon.js

changeIcon.js is a small favicon and title changer library that uses event emitters


Documentation

Basic Usage

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

Other functions

changeIcon.onAnotherTab(title,source)

Changes the icon and title when user switches to another page

changeIcon.onAnotherTab("Noooo!" ,"crying.ico");

changeIcon.onThisTab(callback)

Executes the callback when user turns to the page

changeIcon.addAction("initial","WelcomeBack!","smiling.ico");

changeIcon.onThisTab(() => {
	changeIcon.emitAction("initial");
});

changeIcon.emitAction("original")

That one is a special emitter that turns the title and the icon to their original state

License / Credits

changeIcon.js is released under the MIT license.