will-lumley / FaviconFinder

A small swift library for iOS & macOS to detect favicons used by a website.
MIT License
161 stars 33 forks source link

Issues getting hero image if not main site #84

Closed PatrickAdams closed 1 month ago

PatrickAdams commented 2 months ago

Hi Will,

I've been using your library for a while now and recently updated from a much older version and it seems to have broke a feature that I was relying on where if you were on a sub domain it would look for a hero image.

For example I've been really struggling with https://ign.com. If I look for the favicon on that website it only returns 1 no matter what I set for the preference and it's low quality.

If I grab the favicon for something like https://www.ign.com/articles/alien-romulus-review-fede-alvarez it used to return the hero image instead of the favicon, but now it just returns the one low quality favicon.

If you open a share sheet on iOS, inside any app that allows you to share links (Safari works) there is an image in the share sheet at the top by the title and url. This is the image I would love to be able to get as my favicon. In all cases when I do the share sheet, it has the exact image I want for my favicon. Is there a way to get that one specifically or is Apple doing a lot of magic behind the scenes? So when sharing IGN.com it's a high quality IGN icon, when sharing an article on IGN it's the hero image that shows up.

Any suggestions or help to achieve this?

All the best, Patrick

will-lumley commented 1 month ago

Thanks for raising this issue @PatrickAdams - I really appreciate it. I would also like to apologise for the abysmal response time, this is something I'll be actively working on.

Regarding your issue - I can see what the problem is. IGN is using an open-graph image declared in their HTML, something that FaviconFinder does not account for.

I will ensure that this is patched and released by tonight, in version 5.1.1.

PatrickAdams commented 1 month ago

@will-lumley I appreciate the update!! Thanks so much!

will-lumley commented 1 month ago

No worries @PatrickAdams! In version 5.1.1 this should work now. If you continue to run into issues, feel free to reach out and we'll work through it :)