RealFaviconGenerator / realfavicongenerator

Generate favicon for all major platforms
501 stars 24 forks source link

Order favicons from smallest to largest . #495

Closed ethan-vanderheijden closed 6 months ago

ethan-vanderheijden commented 9 months ago

When I used the generator, it gave me the following code:

...
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
...

but favicons should be ordered from smallest resolution to largest resolution as browsers tend to select the last favicon they see.

If you go to codepad.site on a 4k screen, Firefox will download the 16x16 favicon even though it is being rendered as 40x40. If you swap the order of link tags, it correctly grabs the 32x32 favicon.

Funnily enough, on a 1440p screen, Firefox will correctly grab the 32x32 favicon. (this might be some kind of bug relating to device pixel ratio.)