User:Montekar/monobook.js

// 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://img7.imageshack.us/img7/8320/fav1.gif');