Live data from Hacker News

The complexity of downloading favicons

simplecto.com

21–30 of 39 posts

Re: The complexity of downloading favicons

#21

Another recent complication is serving different favicons for browsers running a dark mode. For example, somehow nytimes.com inverts theirs on my browser and it actually looks great. Sites need to be aware that a dark icon over a transparent background will be invisible in dark mode.

This is an annoying downside of dark mode, which I tend to have enabled on everything all the time: Favicons often don't look good (github, circleci...). Also many slack emoji don't show up.

I don't know if there's a good solution to this. It's unfeasible to require developers to provide two icons, particularly in places that are mothballed. Should browsers always render favicons against a light/white background?

Re: The complexity of downloading favicons

#22
Favicons are also not always defined in , they are automatically requested by the browser whether you have the tag or not. The tag mainly allows you to specify locations and file types other than the default /favicon.ico.

Re: The complexity of downloading favicons

#23

I remember having similar issues a few years ago, I think I ended up using a google service to capture favicons (can't seem to find it anymore) EDIT: Found it! https://www.google.com/s2/favicons?domain= (simply add a domain name after '=' and it will return the website favicon)

Is this a tool that Google made public to developers use or people just found it?

Re: The complexity of downloading favicons

#24
I always try to squash as much of the complexity as I can with some well tested tools or libraries. In this case I'd use imagemagick's convert to resize and convert any of the possible file formats to the type of image I need. Solves a lot of points on this list. For the download part, curl would also solve a few points (ssl, redirects). Of course it depends if you're writing this for a SaaS product, a desktop or mobile Application.

Re: The complexity of downloading favicons

#25

I remember having similar issues a few years ago, I think I ended up using a google service to capture favicons (can't seem to find it anymore) EDIT: Found it! https://www.google.com/s2/favicons?domain= (simply add a domain name after '=' and it will return the website favicon)

I've used this in a side project and it's still very hit or miss. Especially depending on how you format your domain URL.

Re: The complexity of downloading favicons

#26
This article on how ridiculous it is trying to sort favicons out from the end user perspective reminded me of how difficult it was to get right as a creator.

I use this tool: https://realfavicongenerator.net/

Rather than make everything simple it makes everything easy.

Thanks to the Sam for immersing in that subject so others can reap the benefit.

Re: The complexity of downloading favicons

#27
A lot of these problem apply to crawling in general. I run adstxt.com which crawls ads.txt files.

Some issues we have seen:

- Pages that say they are one encoding but are actually another

- Redirects to other sites

- invalid contents or malformed content. How hard should we try to interpret what they meant? For example, an html page that looks like a valid CSV.

- Page too long or extremely slow

- Invalid certs

Re: The complexity of downloading favicons

#29
post #26

This article on how ridiculous it is trying to sort favicons out from the end user perspective reminded me of how difficult it was to get right as a creator. I use this tool: https://realfavicongenerator.net/ Rather than make everything simple it makes everything easy. Thanks to the Sam for immersing in that subject so others can reap the benefit.

I've used https://www.ionos.ca/tools/favicon-generator in the past. It has the image upload ability as well as the ability to quickly draw something on a 16x16 pad for when you just want an absurdly simply icon. (in no way affiliated with the site)

Re: The complexity of downloading favicons

#30
post #11

16: Sometimes it is an animated gif. That's so funny, I've never seen one moving. Do browsers just convert the first frame into a static icon on the fly when they're downloaded or have I just never noticed one moving?

You can even control them with JavaScript which... well, see the game for yourself: http://www.p01.org/defender_of_the_favicon/ (Press N to start, the arrow keys to move.)

This is today's best thing. Thanks. Made in 2008 - everything still working in a modern browser.
Post reply on HN