this post was submitted on 20 Jul 2025
-26 points (25.9% liked)

Programming

21752 readers
108 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] kevincox@lemmy.ml 14 points 5 days ago (1 children)

Sort of...

You can just hope that /favicon.ico works. But 1. it often doesn't and 2. it is often of low quality.

To find a favicon on a modern site you need to load the HTML and check Link headers and <link rel=icon> elements. However you likely can't do this client-side for most sites because of CORS. So you need some server (at the very least to strip CORS). That lets you get the URL but 1. you probably don't want to have connections to external domains for user privacy and 2. some domains will have hot-link protection so you need to fetch the image via your server. You will also want to consider different image formats and sizes to serve the right image to the right client. On top of all of this the site may be using some sort of bot protection which you will have to fight. Google is almost always whitelisted. The site may also have temporary outages so having a cache would be nice, especially if that is almost always populated before you even know the domain exists.

At the end of the day you do want some sort of API. And while it isn't complex it isn't trivial. So it is nice to just let Google handle it. (Other than tracking risks, but you could proxy Google's API.)

[โ€“] ilinamorato@lemmy.world 4 points 4 days ago

Hmm, all of those are fair points. I guess I was just thinking this seems like an overengineered solution to a niche problem, but I suppose for the people who actually have that problem, the solution is good to have.