例えば、通知系のアイコン変更したい場合など、以下のメソッドで favicon アイコンを切り替えることができます。
var favicon = { change: function(iconURL) { this.addLink(iconURL, "icon"); this.addLink(iconURL, "shortcut icon"); }, addLink: function(iconURL, relValue) { var link = document.createElement("link"); link.type = "image/x-icon"; link.rel = relValue; link.href = iconURL; this.removeLinkIfExists(relValue); this.docHead.appendChild(link); }, removeLinkIfExists: function(relValue) { var links = this.docHead.getElementsByTagName("link"); for (var i=0; i<links.length; i++) { var link = links[i]; if (link.type=="image/x-icon" && link.rel==relValue) { this.docHead.removeChild(link); return; } } }, docHead:document.getElementsByTagName("head")[0] };