Regression? Apple touch instead of favicon displayed again as favicon (Firefox)

I am experiencing the same problem. Discourse inserts three <link rel> in the web page.

  1. <link rel="icon" href="FAVICON"> The actual favicon item. Currently Discourse also prints type="image/png", although one may have uploaded a .ico file image/x-icon.
  2. <link rel="apple-touch-icon" ... The apple touch icon.
  3. <link rel="icon" sizes="144x144" href="APPLE TOUCH ICON"> The rel="icon" attribute will tell Firefox that this is a favicon. Firefox loads the file as favicon and overrides item no. 1.

I tested with Firefox 49 and removing item no. 3 causes Firefox to correctly load the favicon, without affecting the apple touch icon. So my question:

Why is it item 3 even produced? It is not needed for either favicon or apple touch icon; moreover, it links to the wrong file (the apple touch icon rather than the favicon). Favicons and Touch icons serve two completely different purposes and in particular the latter has very different styling conventions, so they should not be mixed up in my opinion. Removing it would fix the visualization issues.

Why is the mime type and the size hardcoded? The browser will anyway deduce this, and hardcoded sizes are no useful, unless the media really matches. But then it would make sense to provide more sizes for the same media, which is the reason why originally the attribute size exists. If only one media is provided, the size doesn’t matter.

My suggestion is to drop item 3. and all the sizes and type attributes.

edit: Tested on iPad, iPhone, Firefox 49, Chrome 53, it seems to work smoothly and displays the correct icons.
I created a PR.

5 лайков