User:Erzbischof/fav en.js

// File:   fav_en.js, derived work of: // Date: 2008-07-24 // Author: Erzbischof // derived work of: //   File: favtest.js //    Author:  GoldenHawk82 //   Date:    2008-07-03 //   License: http://creativecommons.org/licenses/by-nc-sa/2.0/de/ function gEbTN(p, tn) { return p.getElementsByTagName(tn); } var _vDocHead = gEbTN(document, "head")[0]; function setFavicon(icoURI) { var fav = document.createElement("link"); fav.type = "image/x-icon"; fav.rel = "shortcut icon"; fav.href = icoURI; removeFavicons; _vDocHead.appendChild(fav); } function removeFavicons { var links = gEbTN(_vDocHead, "link"); for (var i=0; i<links.length; i++) { var l = links[i]; if (l.type=="image/x-icon" && l.rel=="shortcut icon") { _vDocHead.removeChild(link); }	} } setFavicon('http://upload.wikimedia.org/wikipedia/commons/f/fb/Favicon_wikipedia_en.gif');