Switch Favicons With Pure JavaScript – Favic.js

Category: Javascript | April 14, 2017
Author:aligoren
Views Total:335 views
Official Page:Go to website
Last Update:April 14, 2017
License:MIT

Preview:

Switch Favicons With Pure JavaScript – Favic.js

Description:

Favic.js is a pure JavaScript library that automatically changes the favicons when you switch the tabs in the browser. Based on the Page Visibility API.

How to use it:

Import the JavaScript file favic.js into the webpage.

<script src="favic.js"></script>

Initialize the Favic and set the old/new favicons in the JavaScript.

new Favic({
    old: 'old.ico',
    new: 'new.ico'
})

Set the timeout when icon will change.

new Favic({
    old: 'old.ico',
    new: 'new.ico',
    timeout: 0
})

You Might Be Interested In:


Leave a Reply