limesquid / favicon-thief

Find the best favicon for a given URL
MIT License
4 stars 0 forks source link

Improve subdomain fallback #4

Open kamilmielnik opened 1 year ago

kamilmielnik commented 1 year ago

See online.mbank.pl vs mbank.pl. The first one only has 16x16px favicon.ico, but the second one has nice 180x180 favicon.

yuriyyakym commented 1 year ago

Subdomain may have completely different icon, I'm not sure it's a good idea to fallback to a domain's one. Eg. https://mail.google.com/favicon.ico

kamilmielnik commented 1 year ago

Subdomain may have completely different icon, I'm not sure it's a good idea to fallback to a domain's one. Eg. https://mail.google.com/favicon.ico

In this case we'd have icon of the company who made the product instead of an icon of the product. Is it really that bad? I think it's better than no icon. And it works for the example I originally gave.

Anyway, fallback is not necessary here, so it's not a real case. Any real-life counter-examples?

yuriyyakym commented 1 year ago

You're right, but my note was regarding this line:

The first one only has 16x16px favicon.ico, but the second one has nice 180x180 favicon.

Should we fallback to a company logo if we have a low resolution product logo?

In my opinion we shouldn't, but we can improve the algorithm by the comparison of subdomain's and domain's favicons and returning one with a better quality, if favicons are the same but with different resolution.