?
avatar shoulders
shoulders
25 Jan 2018

Steps to reproduce the issue

Place a favicon.ico in the root directory of your website (or template).

Expected result

Nothing should happen.

Actual result

The following is added to the header

<link href="/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />

System information (as much as possible)

Jomla 3.8.3
Gantry 5.4.22
Helium 5.4.22

Additional comments

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

What I would like

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

avatar shoulders shoulders - open - 25 Jan 2018
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jan 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jan 2018
avatar shoulders shoulders - change - 25 Jan 2018
Title
remove favicon auto inserted in the header - it is a better standard
remove favicon auto insertion in the header
avatar shoulders shoulders - edited - 25 Jan 2018
avatar shoulders shoulders - change - 25 Jan 2018
The description was changed
avatar shoulders shoulders - edited - 25 Jan 2018
avatar shoulders shoulders - change - 25 Jan 2018
Title
remove favicon auto insertion in the header
Remove favicon auto insertion in to the header
avatar shoulders shoulders - edited - 25 Jan 2018
avatar shoulders shoulders - change - 25 Jan 2018
The description was changed
avatar shoulders shoulders - edited - 25 Jan 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 25 Jan 2018
Category Feature Request Templates (site)
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jan 2018

Any Comment by Maintainers?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19456.

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jan 2018
Status New Information Required
avatar brianteeman
brianteeman - comment - 26 Jan 2018

I can't confirm the comments in the linked post.

avatar shoulders
shoulders - comment - 26 Jan 2018

This goes into more detail including reference to the HTML5 spec

https://mathiasbynens.be/notes/rel-shortcut-icon

rel="shortcut icon" considered harmful

avatar mbabker
mbabker - comment - 26 Jan 2018

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.

avatar shoulders
shoulders - comment - 26 Jan 2018

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.

avatar brianteeman
brianteeman - comment - 26 Jan 2018

even if it might be redundant it doesnt do any harm does it? and we definitely do not need to have another option

avatar shoulders
shoulders - comment - 26 Jan 2018

Let me see if I can get some specific issues caused by this and then we can go from there.

avatar mbabker
mbabker - comment - 26 Jan 2018

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.

avatar zero-24
zero-24 - comment - 26 Jan 2018

Based on the comments above I'm going to close this issue. Thanks! If you need to remove that you can use the plugin event onBeforeCompileHead as pointed out by @mbabker

avatar zero-24 zero-24 - change - 26 Jan 2018
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2018-01-26 22:40:45
Closed_By zero-24
avatar zero-24 zero-24 - close - 26 Jan 2018
avatar phbernard
phbernard - comment - 1 Feb 2018

(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.

avatar zero-24
zero-24 - comment - 1 Feb 2018

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.

Add a Comment

Login with GitHub to post a comment