Place a favicon.ico in the root directory of your website (or template).
Nothing should happen.
The following is added to the header
<link href="/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
Jomla 3.8.3
Gantry 5.4.22
Helium 5.4.22
The goto favicon generator RealFaviconGenerator in its faq https://realfavicongenerator.net/faq#why_ico_not_declared describes why the favicon should not be declared but still present.
When your favicon is in the root directory, RealFaviconGenerator does not generate this code. This is because it somehow confuses some other browsers like Chrome. And since IE looks for a file named favicon.ico anyway, the best solution is to not even talk about it. This is described by Jonathan T. Neal and Mathias Bynens.
The faq is very extensive about all types of favicon.
I have read https://docs.joomla.org/Special:MyLanguage/Changing_the_site_favicon
Similiar issue #11111
Please can this automatic adding of the favicon.ico be removed as it is no longer needed and can actually cause issues. I would rather not hack core files. (/libraries/src/Document/HtmlDocument.php)
Thanks
Labels |
Added:
?
|
Title |
|
Title |
|
Category | ⇒ | Feature Request Templates (site) |
Status | New | ⇒ | Information Required |
I can't confirm the comments in the linked post.
This goes into more detail including reference to the HTML5 spec
https://mathiasbynens.be/notes/rel-shortcut-icon
rel="shortcut icon" considered harmful
I'm not seeing anything that says the <link>
element should not be there. If anything, we can remove the shortcut relation, otherwise the use of the tag is still perfectly valid even when the icon is found at the site's root.
I am not an expert but all browsers look for the favicon.ico in the root by default so adding this tag seems a a bit redundant unless the favicon.ico it is not in the root.
Maybe add a toggle so we can turn this behaviour off.
even if it might be redundant it doesnt do any harm does it? and we definitely do not need to have another option
Let me see if I can get some specific issues caused by this and then we can go from there.
The only thing to be gained that I am aware of is removing ~60 bytes from the rendered HTML document. No browser I'm aware of actually has an issue with the tag's presence, and the fallback behavior is a browser specific decision and one that I'm not aware is a specification anywhere.
If the tag's presence is really that annoying though, as with all metadata in the document, a plugin can be used with the onBeforeCompileHead
event to remove the line.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-01-26 22:40:45 |
Closed_By | ⇒ | zero-24 |
(this comment is not an invitation to re-open this issue, just additional thoughts for reference)
Declaring favicon.ico
is not completely neutral. For example, when it is declared, Windows Chrome is using it. In addition, if this file embeds several resolutions, Chrome picks the one with the lowest resolution (eg. 16x16). This can produce sub-optimal results, especially if other PNG, higher resolution icons were provided (eg. 32x32, and intended to be used instead of the old favicon.ico
).
The important point is that this behavior should be prevented by a Joomla plugin which purpose is to setup a favicon. As far as I understand @zero-24 comment, this is what onBeforeCompileHead
does.
The important point is that this behavior should be prevented by a Joomla plugin which purpose is to setup a favicon. As far as I understand @zero-24 comment, this is what onBeforeCompileHead does.
Just for reference. This can be prevented using the onBeforeCompileHead Plugin event. Currently there is no Plugin in the core that sets or unsets the favicon thing. But if you want you can use or write a Plugin that can do this kind of thing using the mention Plugin event.
Any Comment by Maintainers?
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19456.