A small script to add notification bubble to favicon
If you don't have a nice favicon set on app, read this: https://github.com/audreyr/favicon-cheat-sheet
npm install favicon-notification
bower install favicon-notification
If you are using Webpack or Browserify, do:
var FaviconNotification = ;// When your app loadsFaviconNotification;// On some eventFaviconNotification;// If you want to remove the notificationFaviconNotification;
If you are using RequireJS, for example, load normally (remeber to set the alias in your RequireJS config):
Load the script file:
This script assumes that you have a
/favicon.ico set. See how setup your favicon. If are you using another path to your favicon, you can set it by passing some options to this method. You can set a different fill and line color too (defaults are fill red and white line).
As the name says, this add the notification bubble to the favicon. If you didn't initialized the script using
.init(options), this will use the default options to create and set the new favicon with the notification.