// ==UserScript==
// @name           twitter favicon changer
// @namespace      http://oquno.com/
// @description    change twitter favicon to user icon
// @include        http://twitter.com/*
// ==/UserScript==
(function(){
	var icon = document.evaluate(
			"//h2//img[@id='profile-image']",
			document,
			null,
			7,
			null
			);
	if(icon.snapshotLength == 0) 
		return;
	icon = icon.snapshotItem(0);
	var links = document.getElementsByTagName('link');
	for(var i=0; i<links.length; i++){
		var link = links[i];
		if (link.rel == "shortcut icon"){
			/* thanks to os0x! http://oquno.com/log/eid1947.html#comments */ 
                       var f = link.cloneNode(false);
	               f.href = icon.src;
	               var head = link.parentNode;
	               head.removeChild(link);
	               head.appendChild(f);
	               break;
		}
	}
})();

