Favicon not showing up in Google Chrome browser

南楼画角 提交于 2021-02-08 15:44:19

问题


For some reason my favicon is not showing up on my chrome tab. From all the articles I have read I am writing the code correctly. It does work in Firefox. I also cleared my cache and tried an incognito window and am still not seeing it.

When I go to: localhost:8080/favicon.ico I do see the favicon.

Here is my code within the HTML header:

<link rel="shortcut icon" sizes="16x16 32x32 64x64" 
href="/favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />

Any help would be appreciated! Thanks!


回答1:


Try doing a favicon cache reset as explained in #3 here

  1. FAVICON CACHE RESET

A more drastic way to solve the problem, but that allows you to do it globally rather than site-by-site, is to clear the browser’s favicon cache. The procedure is:

  • on Mac: delete the following file

    ${user.home}/Library/Application Support/Google/Chrome/Default/Favicons
    
  • on Windows: delete Favicons-journal and Favicons files from the following location

    C:\Users\nomeutente\AppData\Local\Google\Chrome\User Data\Default
    

In both cases, a browser restart is suggested.




回答2:


You should link your favicon.ico like below:

<link rel="icon" href="wherever/your_icon/is?v=1.0" />

The thing is that, chrome could not find it for the first time and now it's assuming you don't have one as it renders from cache. The ?v=1.0 part makes sure that chrome loads it again.




回答3:


right-click on file (the favicon), go to properties, look towards the bottom and you will see attributes and the option to unblock the file, and unblock it. Worked immediately with browser-sync Blind luck, I wasn't even expecting it to be there.




回答4:


I am not sure why you have all of that extra icon formatting that isn't really needed. My icons only look like this: <link rel="icon" href="favicon.ico">. I would suggest you try that (unless the rest is absolutely needed). Also, it is possible that it just isn't loading properly. Whenever I set up my icons, depending on what I do it on (server or by clicking on index.html file), sometimes I have to reload it a few times.




回答5:


I have same issue. I have tried most suggestions, including; changing icon name, deleting chrome's local favicons file, ico and png formats, clearing cache. No joy with any of these attempts to fix.

I have 2 projects with same header and it works with 1 icon but not the other? It works in IE but will not work in chrome. I'm convinced it is to do with the Chrome Favicons-journal but not sure how to prove it.

Will reinstall Chrome and see how that goes :(




回答6:


I had tried a lot different things. My 1 machine kept showing them wrong, but they were fine on all my other machines. I even deleted my entire:

C:\Users\\AppData\Local\Google\Chrome\User Data

Folder and copied one from a working machine. When I first launched Chrome, they were fine... but went bad again soon after.

Then I noticed that every time I'd launch a bookmark from Chrome on my Android phone, the icon on my bad machine would come back. But it seemed like I first needed to click on the bad bookmark, then navigate elsewhere, before it updated my bad machine (not 100% sure of this).

So anyway, I just went through all my bad bookmarks through my phone, and they all came back on my bad machine.

Now, I'm almost certain I had tried the same process from a good PC, but didn't work. Again, I'm not 100% certain of this.

Hopefully, this can be tested with others.



来源:https://stackoverflow.com/questions/44664111/favicon-not-showing-up-in-google-chrome-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!