The Mystery of the Changing Favicon

Alvaro Montoro recently had a weird issue where the favicon shown in Firefox differed from that in other browers, even though it was the same favicon.ico file. It was puzzling: the favicon worked differently depending on the browser. Chrome and Safari showed the correct favicon (with the corporate logo) while Firefox showed a completely different …


This content originally appeared on Bram.us and was authored by Bramus!

Alvaro Montoro recently had a weird issue where the favicon shown in Firefox differed from that in other browers, even though it was the same favicon.ico file.

It was puzzling: the favicon worked differently depending on the browser. Chrome and Safari showed the correct favicon (with the corporate logo) while Firefox showed a completely different logo (with some letters.) And we double-checked that the file was the same, not an old cached version. It was the exact same file… but it was different.

As I hinted on Twitter:

Turns out that was exactly the case. When multiple icons are embedded in an .ico file, Firefox will choose the last one.

The .ico file had multiple layers (or icons) in it. The top layer (first icon) was the one that Chrome and Safari displayed, and the bottom layer (last icon) was the one that Firefox was displaying.

The Mystery of the Changing Favicon →

~

When it comes to favicons, the HTML spec currently reads:

If there are multiple equally appropriate icons, user agents must use the last one declared in tree order at the time that the user agent collected the list of icons.

No word on resources with multiple embedded icons though … so currently either behavior can be right. I’ve filed an issue at the WHATWG, asking to clarify the spec text on this.

whatwg/html Issue #7584: Icon sources with multiple embedded icons →


This content originally appeared on Bram.us and was authored by Bramus!


Print Share Comment Cite Upload Translate Updates
APA

Bramus! | Sciencx (2022-02-05T20:06:05+00:00) The Mystery of the Changing Favicon. Retrieved from https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/

MLA
" » The Mystery of the Changing Favicon." Bramus! | Sciencx - Saturday February 5, 2022, https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/
HARVARD
Bramus! | Sciencx Saturday February 5, 2022 » The Mystery of the Changing Favicon., viewed ,<https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/>
VANCOUVER
Bramus! | Sciencx - » The Mystery of the Changing Favicon. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/
CHICAGO
" » The Mystery of the Changing Favicon." Bramus! | Sciencx - Accessed . https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/
IEEE
" » The Mystery of the Changing Favicon." Bramus! | Sciencx [Online]. Available: https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/. [Accessed: ]
rf:citation
» The Mystery of the Changing Favicon | Bramus! | Sciencx | https://www.scien.cx/2022/02/05/the-mystery-of-the-changing-favicon/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.