Large

Faviconize Google (nested icons)

By NV Last update Apr 26, 2013 — Installed 23,262 times.

Icons on right

in
Subscribe to Icons on right 2 posts, 2 voices



tunayx User
OperaWindows

How can I put the icons to right side? Thanks for this useful script.

 
NV Script's Author
ChromeMacintosh

Short answer: you can't. I'd prefer icons on left side and I don't want to maintain two versions.

Long answer: you can apply this patch:

@@ -27,7 +27,6 @@
 }\
 #res .favicon {\
 	left: 0;\
-	position: absolute;\
 	top: 2px;\
 	z-index: 9;\
 }\
@@ -45,14 +44,14 @@
  */
 function add_favicons_to(links) {
 	for (var i=0; i<links.length; i++) {
-		if (links[i].firstChild.className != 'favicon') {
+		if (!links[i].parentNode.nextSibling || links[i].parentNode.nextSibling.className != 'favicon') {
 			var host = links[i].href.replace(/.*https?:\/\//, '').replace(/\/.*$/,'');
 			var img = document.createElement('IMG');
 			img.src = FAVICON_GRABBER + host;
 			img.width = '16';
 			img.height = '16';
 			img.className = 'favicon';
-			links[i].insertBefore(img, links[i].firstChild);
+			links[i].parentNode.parentNode.insertBefore(img, links[i].parentNode.nextSibling);
 		}
 	}
 }

Google layout changes so often, so I'm sure this patch soon will be broken.