Hacker News new | past | comments | ask | show | jobs | submit login

The standard way involves a meta tag, right?



That's my understanding of how it's worked for decades...

1. Check for <link rel="icon" ...> tag(s)

2. Check for /favicon.ico

3. ...give up?

Someone correct me if I'm wrong!


One major issue is that the "standard" favicon size has historically been 16x16 pixels... which, in the age of high density displays will render either comically small or comically blurry. There are other meta tags like Apple's "apple-touch-icon" which has some higher resolution options. But already you can see the logic here isn't trivial.


It still seems trivial to me. Parse all meta icon tags, prefer one that matches exact client resolution of current display (don't even have to download the icons - the sizes are defined as part of the meta tag), else use the largest-resolution one, else in desperate bid try site/favicon.ico, otherwise give up.

Really shouldn't be complicated enough to need a special service to handle "edge cases".

Another comment mentions web manifest - I guess try those first before meta tags, or whatever order the standard says to use. I mean, we're talking a web browser here, it's designed to do these kind of tasks.


I guess the problem is when you want to quickly provide a favicon with the search result (beit in the omnibar or actual search page), as you're typing and results are being displayed you cannot send off a request to the site, wait for HTML html to finish up downloading, send off a request to the manifest if its defined for multiple sites at once.

On a technical level of course its doable but in reality it's a complete waste of data and processing, not to mention it could take a long time to show up. I imagine they have these favicons all cached on their side so they can quickly send the right file down and/or do this processing if needed.

That being said maybe they should just not use a favicon if it's that big of a deal.


Oh, this is for putting an icon next to search results? Yeah, that changes the calculus considerably. I thought this was about showing the favicon in the browser for a site the user visits (per the issue title).

In that case, yeah, I don't think the icons are necessary to show at all...


Even if you wanted to implement this, the logic of the service could be directly embedded in the browser as an extension or similar. There’s no reason to depend on a network service for this functionality.


I feel like the only user benefit is to see the favicons of sites you are familiar with, so caching those locally after you visit sites is probably good enough.


You can also set it in JS still a meta tag and image I guess though. It's how some sites do the notification badge thing that is animated.


Can't seem to edit my comment on this app, but I believe you may also be able to set these in a web manifest json file too.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: