Html Firefox 不显示网站图标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6180343/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Firefox doesn't show favicon
提问by Denis
I created favicon.ico file and declared it in my HTML head tag:
我创建了 favicon.ico 文件并在我的 HTML head 标签中声明它:
<link type="image/x-icon" href="favicon.ico" rel="icon" />
<link type="image/x-icon" href="favicon.ico" rel="shortcut icon" />
IE 8 and Opera handle it great but FireFox does not even try to load it (as I see from my Fiddler debug proxy). I've tried many different type (image/ico etc.) and href params but no luck.
IE 8 和 Opera 处理得很好,但 FireFox 甚至不尝试加载它(正如我从 Fiddler 调试代理中看到的那样)。我尝试了许多不同的类型(图像/ico 等)和 href 参数,但没有运气。
What did I miss?
我错过了什么?
采纳答案by Zach Rattner
Like most things in the browser, favicons (or lack thereof) are common candidates for caching.
像浏览器中的大多数东西一样,图标(或缺少图标)是缓存的常见候选者。
Try clearing your browser cache.
尝试清除浏览器缓存。
In Mozilla Firefox, the keyboard shortcutto "Reload (override cache)"is
在Mozilla Firefox浏览器中,键盘快捷键,以“刷新(覆盖缓存)”是
- Ctrl+ F5OR
- Ctrl+ Shift+ R
- Ctrl+F5或
- Ctrl+ Shift+R
回答by iiR
Firefox has separate cache for favicon and this does not work properly. The favicon is not updated easily in firefox. This is a small issue but troubles many of us for long time.
Firefox 有单独的图标缓存,这不能正常工作。图标在 Firefox 中不容易更新。这是一个小问题,但长期以来困扰着我们许多人。
The solution is to clear the favicon cache so that the favicon is update. There are many solutions you can find if you go through the internet or stackoverflow. Most of the solution imvolves deleteing the favicon cache manually or using some plugins. Some saying deleting the file from temp internet files. But there is one really simple and easy way to fix the problem.
解决方案是清除网站图标缓存,以便更新网站图标。如果您通过 Internet 或 stackoverflow,可以找到许多解决方案。大多数解决方案涉及手动删除网站图标缓存或使用一些插件。有人说从临时 Internet 文件中删除文件。但是有一种非常简单易行的方法可以解决这个问题。
- Type in www.yoursite.com/favicon.ico (or www.yoursite.com/apple-touch-icon.png, etc.)
- CTRL + F5 or CTRL + R
- 输入 www.yoursite.com/favicon.ico(或 www.yoursite.com/apple-touch-icon.png 等)
- CTRL + F5 或 CTRL + R
This will immediately update the favicon.
这将立即更新网站图标。
This solution was originally posted by 'alex' at this link: How do I force a favicon refresh
此解决方案最初由“亚历克斯”在此链接上发布: How do I force a favicon refresh
回答by Petr Hladík
My problem was that I had another favicon.ico in a web root directory.
我的问题是我在 web 根目录中有另一个 favicon.ico。
If You have a favicon in template directory "/template/favicon.ico" and another one in "/favicon.ico" firefox will use the favicon from root direcory even though you've used a link for favicon in template folder. Solution is delete the favicon in root directory.
如果您在模板目录“/template/favicon.ico”中有一个 favicon,而在“/favicon.ico”中有另一个 favicon,即使您在模板文件夹中使用了 favicon 链接,firefox 也会使用根目录中的 favicon。解决办法是删除根目录下的favicon。
My current version of firefox is 58.0b6 (Quantum).
我当前的 Firefox 版本是 58.0b6 (Quantum)。
回答by Lockhead
That's strange, because I just copy/pasted your code to a blank document, opened with firefox and some random image I renamed to favicon.ico loaded up as the favicon.
这很奇怪,因为我只是将您的代码复制/粘贴到一个空白文档中,用 Firefox 打开,我将一些随机图像重命名为 favicon.ico 作为 favicon 加载。
Maybe try this? http://help.godaddy.com/article/4145
回答by JingleOtoko
I am not much of a programmer but I had a similar problem and here is the simple thing that finally worked for me...
我不是一个程序员,但我遇到了类似的问题,这是最终对我有用的简单事情......
I admin several simple websites but Firefox refused to load the favicon of one in particular site. I looked online, tried everything I was able to understand. Nothing worked. The code was exactly the same (copied in fact) from the other websites whose icons worked well.
我管理了几个简单的网站,但 Firefox 拒绝加载某个特定网站的图标。我在网上看,尝试了我能理解的一切。没有任何效果。代码与其他图标运行良好的网站完全相同(实际上是复制的)。
Eventually it dawned on me that maybe Firefox did not like the path I used to get there. This site was a forwarded URL being hosted on my own domain. (i.e. personal domain is myplace.ca and the favicon that would not load was part of registered URL something.com which was actually located at myplace.ca/PutItHere/) If I used the registered URL (something.com) no favicon. If I use the real path in the browser, suddenly favicon! All I had to do was bookmark the absolute path rather than the registered domain!
最终我意识到,也许 Firefox 不喜欢我以前到达那里的路径。该站点是一个转发的 URL,托管在我自己的域上。(即个人域是 myplace.ca 并且不会加载的图标是注册 URL something.com 的一部分,它实际上位于 myplace.ca/PutItHere/)如果我使用注册的 URL (something.com) 没有图标。如果我在浏览器中使用真实路径,突然出现favicon!我所要做的就是为绝对路径而不是注册域添加书签!
回答by IceWarrior353
I also found, that if you reference the full URL path, you may need to reference the URL WITH www. in it, otherwise it may not load.
我还发现,如果您引用完整的 URL 路径,则可能需要引用带有 www 的 URL。在其中,否则可能无法加载。
回答by Kyle Coots
So just had an issue with favicons not showing in Firefox v70.0.1.
所以只是在 Firefox v70.0.1 中没有显示图标的问题。
Now this will probably only be an issue for a very few people and most likely only if you have modified the about:configsettings in FF
现在这可能只对极少数人来说是一个问题,而且很可能只有在您修改了FF 中的about:config设置时
This issue for me was the setting privacy.resistfingerprintingwas set to trueon some sites this will block favicons.
对我来说这个问题是设置privacy.resistfingerprinting在某些网站上 设置为true,这将阻止收藏夹图标。
The other issue I noticed and what lead me to find out what was causing the issue was using dropzone.js on a site I was creating the uploaded images had a blank preview. The previews are base64 encoded and were being blocked by this.
我注意到的另一个问题是什么让我找出导致问题的原因是在我创建上传图像的网站上使用 dropzone.js 有一个空白的预览。预览是 base64 编码的,因此被阻止。
Like I said most likely wont be an issue for most but wanted to post this somewhere so it may help others that may be facing a similar issue as I did.
就像我说的那样,对大多数人来说很可能不会成为问题,但想将其张贴在某个地方,这样它可能会帮助可能与我一样面临类似问题的其他人。
See more here: https://wiki.mozilla.org/Security/Fingerprinting
在此处查看更多信息:https: //wiki.mozilla.org/Security/Fingerprinting
And Here: https://bugzilla.mozilla.org/show_bug.cgi?id=1452391
回答by Tennom
Here it's in 2017. Firefox didn't pick up my favicon called "favicon-32x32.png", while Chrome was showing. I changed the file name to "favicon.png", AND refreshed as folks showed above, it worked great. I'm using:
Firefox version 55.0
Chrome version 60.0
这是在 2017 年。 Firefox 没有选择我的名为“favicon-32x32.png”的图标,而 Chrome 正在显示。我将文件名更改为“favicon.png”,并像上面显示的那样刷新,效果很好。我正在使用:
Firefox 55.0
版 Chrome 60.0版