Site Icon Changer

By Gabe Gorelick Last update Oct 31, 2007 — Installed 2,919 times.

Archived Comments (locked)

Subscribe to Archived Comments 5 posts, 4 voices

Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

Gabe Gorelick Script's Author

Update: I think the answer lies in using an xpath query to see whether there is a <link /> with rel="shortcut icon". I'm working on implementing this but so far it is not able to find one ever, even when a site clearly has one. I'll keep working on it.

Gabe Gorelick Script's Author

In response to Kid_ReeFer:
It would be nice if you could, like you said, set a default favicon for sites that don't have one. However, distinguishing what sites don't would be very tricky. You'd have to 1. include all sites in the @include value and 2. somehow scan the html to see whether it specifies a favicon. However, this wouldn't work if the favicons were set server side (I don't know if this is possible though). Maybe I'll work on that. By the way, in response to Henrik Nyh, the 'px' may not be strictly necessary, but it's there for redundancy.

Henrik N Admin

Should "link.setAttribute('height', '16px');" and ditto for width really include the "px" unit? I don't believe the height/width attributes take units.

Oh, and also: it seems like Firefox adjusts favicon sizes to stay within the proper bounds even without having to do something like this, so if setting those attributes works, it will probably only serve to force the icon to be a perfect square.

Haven't actually tried any of that, just guessing. ;)

Kid_ReeFer User

This is Great, I was looking for a replacement for the "Favicon Picker" extension...and I think this is potentially it!!One thing though,
any way to set a sort of default favicon for all sites that dont contain one?