13 juni, 2004

Favicons as part of a link.

Yesterday I was thinking that it would be nice to include the favicons for a site next to the link. It would look cool in the favorites list I keep on this page.

My inital thought was to create a taglib that would fetch and parse the linked page and extract the <link rel="SHORTCUT ICON" href="shortcut url" /> since I thought this was the prefered way of defining favicons. But after a little looking around I found that most is using the basic way of just putting a favicon.ico in the root of their web site, so I concluded that my idea should be really simple to implement, just put a

<img src="website url/favicon.ico" />
where ever I want to use a favicon for a site.

The above is offcourse all dependent on Firefox (IE should be fine right, they introduced this stuff ;-) ability to render .ico images in web pages. So I started to "convert" my favorites list to include a favicons next to the links and look and behold it worked fine in Firefox.

The image a the left shows how my initial attempt looked in Firefox (click image for larger view).

So now for the last step to verify that it also works as expected in IE - and it does NOT. A couple of the favicons will show up, but most will be shown as missing images.

So for now I am back to my initial plan but with some extra work to do. Because to acomodate IE it is no longer just a matter of picking up the icon location but now I will also have to convert the fetched icon to png and cache it locally.

Suddenly everything becomes rather complicated, so I think that I will leave this be for now and return when I have a better time.

BTW, I should probably get around to creating a favicon for this site. I have seen them animated on some sites and cannot really determine if that is a good idea - looks really cool in Firefox, do not know if it will work in IE (you never know).

Ingen kommentarer:

Tilføj en kommentar