Dynamically change a favicon using a data uri string, typically
from canvas.toDataURL().
$ component install component/favicon
Count from 0 through 9:
varicon=require('favicon');varcanvas=document.createElement('canvas');canvas.width=canvas.height=16;varctx=canvas.getContext('2d');ctx.font='16px Helvetica, Arial, sans-serif';varnums=[0,1,2,3,4,5,6,7,8,9];vari=0;setInterval(function(){ctx.clearRect(0,0,16,16);varn=nums[i++%10];ctx.fillText(n,0,15);icon(canvas.toDataURL());},300);Set the favicon to the given data uri string.
Reset to the original favicon.
MIT