Question
When my site is local (using the file:// protocol), favicon does not appear in Chrome or Safari, but works in Firefox (everything on Mac). However, when the same site is actually hosted, favicon works fine in all the browsers I tried. Why don't web browsers display local icons?
More details
The favicon.ico file is in the same directory as the index.html page. I use the following code, although I tried several variations of it:
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
Since favicon works when accessed via http:// , I doubt that something is wrong with the way I turn it on, but you never know ...
Update
I found several forum posts (not too formal) that suggest that this is by design, but none of them provide a rationale. Also, it seems that some versions of IE have the same problem. Is there a security risk with local icons? (I know that some browsers have problems with local cookies, for example.)
Disclaimer: It seems that at the same time there are a ton of questions, but I did not find exactly that. (Actually, I basically have the same question as this one , but none of the answers there worked for me.)
html cross-browser google-chrome favicon webkit
Matthew Adams Jun 27 '12 at 7:26 2012-06-27 07:26
source share