While implementing default topsites, I noticed if I try to loadIntoView the icon from "https://en.wikipedia.org" it uses the generic "W" text icon. It loads the correct Wikipedia icon if I use "https://wikipedia.org" or the final redirect of "https://en.wikipedia.org/wiki/Main_Page"
Maybe we could just use the base domain here for loading these images 🤔 not sure if a page ever has a different icon we would need to load than the base domain?
Revisiting this, as it seems partially fixed. A broken site example: https://www.playstationtrophies.org/forum/shenmue-iii/341387-shenmue-iii-trophy-guide-roadmap.html
The icon loads fine on Desktop Firefox for the above and playstationtrophies.org direct loads the icon on mobile, but the link above still doesn't load the icon. Another site that has issues is gamefaqs.gamespot.com.
Yes the wikipedia issue seems fixed but can reproduce with gamefaqs.gamespot.com
Looking at gamefaqs.gamespot.com I see that the page does not define any icons in its markup. So we are likely falling back to loading favicon.ico. Since that is only 32x32 pixels in size, we are likely discarding it since that is a too low quality for most of our UI. See https://github.com/mozilla-mobile/android-components/issues/3814.
https://brickseek.com/walmart-inventory-checker/?sku=719650769
Icon will load, but is lost on close and launch of Firefox. Does the discarding of low res icons happen the first time it tries to load, or subsequent times? Is that what is happening here, or is it something else?
Edit: root URL does the same thing.
This looks like a different problem. The icon should always get discarded. If it loaded once and then later disappears then this is caused by something else. This sounds like https://github.com/mozilla-mobile/android-components/issues/7264.
@quadriflax A fix for that problem should be available in Nightly now. Can you still reproduce this?
The icon issue seems to have resolved for Brickseek link, but not for playstationtrophies.org link. So for this link, I still get no icon at all: https://www.playstationtrophies.org/forum/shenmue-iii/341387-shenmue-iii-trophy-guide-roadmap.html, even though the main domain does have an icon and that icon does stay when I add to top sites.
However, I think this may be a different issue (ie, the page isn't defaulting to pull the link from the main page), so the disappearing icon issue does seem to have resolved from what I can tell.
Looking at playstationtrophies.org it looks like they do not define any icons in their markup. This means we will fallback to loading https://www.playstationtrophies.org/favicon.ico and that seems to be only a 16x16 icon. This is too small and we will not try upscaling this. So this is kind of the intended behavior. In AC we have the following issue about discussing changing this: https://github.com/mozilla-mobile/android-components/issues/3814
I am closing this since the original issue seems fixed. But please open a new issue if you see problems with icons and then I can investigate them (feel free to file them in the AC repository directly). But let's definitely have separate issues to not have those never ending issues. :)
The odd thing is, it does pull the favicon (and saves it) if you land on playstationtrophies.org, but not for the other pages. I see what you're saying, but it's an inconsistent behavior, if nothing else.
Yeah, the main page has an apple touch icon in its markup:
https://www.playstationtrophies.org/apple-touch-icon.png
However the forum pages don't. So we do not use the other one - since we use what is provided by the page we are on.
If I'm understanding correctly, this means the main page markup overrides the favicon with the apple icon, whereas the sub pages have no such specification, and thus fallback to the main page favicon, which is too low res.
Assuming that is correct, could Firefox fallback to whatever is specified in the markup of the main page, if the sub pages are not specifying? In this case, that would be the apple icon, which would "override" the favicon. Perhaps that's too much of a reach.
Not a huge deal, just curious. I appreciate the info you've shared. This is all new to me. Thanks!
Assuming that is correct, could Firefox fallback to whatever is specified in the markup of the main page, if the sub pages are not specifying? In this case, that would be the apple icon, which would "override" the favicon. Perhaps that's too much of a reach.
I think the problem with this solution is:
I think the only way out is considering loading the low res icon - which other browsers do. But that may look pretty bad in parts of the UI. Some browser seems to fallback to showing the low res icon where it kind of works (e.g. in the tab) but fallback to the generated one in situations where it does not (e.g. a list of history with large icons).
All of that makes sense. The only thing I would add is that I think even a low res icon on mobile wouldn't be terrible, and it makes it easier to see which icon is which. The default letter doesn't give a quick visual cue, which is beneficial for something like a "top sites" icon. But maybe that's just me, and it's far from a deal breaker to not have one.
Most helpful comment
Maybe we could just use the base domain here for loading these images 🤔 not sure if a page ever has a different icon we would need to load than the base domain?