Last modified: 2014-09-24 01:27:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21392, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19392 - Favicon, apple-touch-icon links matching the defaults should not be sent
Favicon, apple-touch-icon links matching the defaults should not be sent
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Low enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Main_Page
: mobile, patch, patch-reviewed
Depends on:
Blocks: 27911
  Show dependency treegraph
 
Reported: 2009-06-25 15:30 UTC by Laurence 'GreenReaper' Parry
Modified: 2014-09-24 01:27 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Change $wgFavicon default from '/favicon.ico' to false (1.56 KB, patch)
2009-06-25 22:14 UTC, Laurence 'GreenReaper' Parry
Details
Don't output links if $wgFavicon or $wgAppleTouchIcon are equivalent to their defaults (1.77 KB, patch)
2009-06-25 22:17 UTC, Laurence 'GreenReaper' Parry
Details
Unified version of patch 6272, patch 6273 (1.78 KB, patch)
2009-06-25 22:36 UTC, Laurence 'GreenReaper' Parry
Details

Description Laurence 'GreenReaper' Parry 2009-06-25 15:30:57 UTC
Every page on the Wikipedia outputs headers similar to the following:
<link rel="apple-touch-icon" href="http://en.wikipedia.org/apple-touch-icon.png" />
<link rel="shortcut icon" href="/favicon.ico" />

These headers are unnecessary because (in this case) the locations are the default location for the files concerned. They will be checked anyway by user-agents that make use of such files, so pointing to them is a waste of space (137 bytes uncompressed, ~28 bytes gzipped; about 0.2% of the page, but a more significant portion of the <head>). 

Apple touch icon reference:
http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html

Shortcut icon reference:
http://msdn.microsoft.com/en-us/library/ms537656%28VS.85%29.aspx

Before these links are output, the rendering code should check that they do not match the defaults, perhaps by expanding them with wfExpandUrl and comparing the two. If so, it should not output the links. (The documentation for these variables should be updated to indicate this feature.)

The protocol and host name of the apple-touch-icon also appears unnecessary; a relative path should be sufficient to specify a path on the current server. If that is removed too, it's worth testing setting an iPhone bookmark with a https: URL, just to ensure it still works.
Comment 1 Laurence 'GreenReaper' Parry 2009-06-25 22:14:34 UTC
Created attachment 6272 [details]
Change $wgFavicon default from '/favicon.ico' to false

User agents will look for /favicon.ico without us telling them about it. There is therefore no need to output it by default.

Documentation update required at http://www.mediawiki.org/wiki/Manual:$wgFavicon if committed.
Comment 2 Laurence 'GreenReaper' Parry 2009-06-25 22:17:05 UTC
Created attachment 6273 [details]
Don't output links if $wgFavicon or $wgAppleTouchIcon are equivalent to their defaults

If the above patch to DefaultSettings is not merged but this one is, an additional check for '/favicon.ico' != $wgFavicon may be appropriate after the null check but before the wfExpandUrl check, to save the expense of expanding.
Comment 3 Laurence 'GreenReaper' Parry 2009-06-25 22:36:38 UTC
Created attachment 6274 [details]
Unified version of patch 6272, patch 6273

Resubmitting in unified format diffed from SVN
Comment 4 Chad H. 2009-07-27 23:43:11 UTC
Applied in r53841.
Comment 5 Chad H. 2009-08-25 22:29:07 UTC
Reverted in r55588. Brion seems to think it won't work in Firefox, and testing in Chrome seems to say the same thing.
Comment 6 Laurence 'GreenReaper' Parry 2009-08-25 23:25:43 UTC
This does not appear to be the case here. Try http://stats.wikifur.com/ for an example. Works for me in both Chrome and Firefox, latest versions.

If you have a negative cache hit for favicon.ico for a site, that will cause the favicon not to show up if you subsequently put a favicon.ico file there but do not clear the cache, and do not explicitly indicate the presence of one in your HTML.
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2009-08-26 03:04:40 UTC
In theory this should work fine, at least for favicon.  Originally favicon didn't have a link tag at all, it was hardcoded to /favicon.ico.  So all browsers should support retrieving it from that location if there's no link tag.
Comment 8 Laurence 'GreenReaper' Parry 2009-08-26 03:06:57 UTC
Apple specifies (above) that the sitewide icon be put in the root folder; the <link> is only intended as a page-specific override.
Comment 9 Laurence 'GreenReaper' Parry 2009-08-26 03:07:53 UTC
To clarify: "that the apple-touch-icon be put in the root folder..."
Comment 10 Sumana Harihareswara 2011-11-10 02:25:50 UTC
Laurence, thank you for your patch.  From the comments, I infer that the open question of whether your patch works means that it still needs review, so I've added the "need-review" keyword on this bug.  If you'd like to and you have time, I invite you to ensure that your patch still applies to current trunk in SVN, and possibly revise and update it if it doesn't.  Thanks again.
Comment 11 Michael Zajac 2013-03-21 19:21:56 UTC
Why not drop the Microsoft file format and standardize on PNG?

<link rel="shortcut icon" href=/favicon.png type=image/png />
Comment 12 Tomasz W. Kozlowski 2013-04-17 23:45:43 UTC
Internet Explorer does not support PNG files as favicons.
Comment 13 Michael Zajac 2013-04-18 01:10:07 UTC
I believe MSIE 7 and newer support png favicons. I think MSIE 6 users will have about 100 other shortcomings to worry about before they come to the missing favicon, but I have no problem with providing an .ico file too, if someone wants to make the effort.

(As long as we’re taking pains to provide proprietary formats for obsolete browsers, why don’t we start including video and audio in mpeg4 for the millions of visitors who can’t use .ogg?)
Comment 14 Laurence 'GreenReaper' Parry 2013-04-18 01:29:06 UTC
Belief is insufficient in this case. Internet Explorer does not support PNG files as favicons. (On the plus side, Windows 8 *does* support PNG files as tile icons.)
http://www.jonathantneal.com/blog/understand-the-favicon/
Comment 15 Tomasz W. Kozlowski 2013-04-25 13:15:53 UTC
The Apple Touch icon part is now fixed with Gerrit change #60777. 

We now have 'wgAppleTouchIcon' => array( 'default' => false, ) which means that MediaWiki will not generate links to Touch icons in HTML <head /> tag, and will make iOS use the default 'apple-touch-icon.png' file located in domain docroot, which it looks for by default anyway.

Project-specific icons, and icons for projects without a docroot (for instance $lang.wiktionary.org) should be committed into docroot/bits/apple-touch/ and defined in InitialiseSettings.php, for instance:

  'dewiktionary'  => '//bits.wikimedia.org/apple-touch/wiktionary/de.png',

Some good ideas about the actual creation of such icons are gathered in bug 27911.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links