Firefox 不显示网站图标
我创建了 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 和 Opera 处理得很好,但 FireFox 甚至没有尝试加载它(正如我从 Fiddler 调试代理中看到的那样)。我尝试了许多不同的类型(image/ico 等)和 href 参数,但没有运气。
我错过了什么?
I created favicon.ico file and declared it in my HTML head tag:
<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.
What did I miss?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
与浏览器中的大多数内容一样,网站图标(或缺少图标)是缓存的常见候选者。
尝试清除浏览器缓存。
在 Mozilla Firefox 中,键盘快捷键 为 "重新加载(覆盖缓存)” 是
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 shortcut to "Reload (override cache)" is
Firefox 对图标有单独的缓存,但它无法正常工作。 Firefox 中的图标不容易更新。这是一个小问题,但却困扰了我们很多人很长时间。
解决方案是清除图标缓存,以便更新图标。如果你通过互联网或 stackoverflow,你可以找到很多解决方案。大多数解决方案涉及手动删除图标缓存或使用一些插件。有人说从临时互联网文件中删除该文件。但有一种非常简单易行的方法可以解决这个问题。
这将立即更新 favicon。
该解决方案最初由“alex”在此链接中发布:
如何强制刷新网站图标
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.
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.
This will immediately update the favicon.
This solution was originally posted by 'alex' at this link:
How do I force a favicon refresh
这很奇怪,因为我只是将您的代码复制/粘贴到一个空白文档中,用 firefox 打开,并重命名为 favicon.ico 的一些随机图像作为 favicon 加载。
也许试试这个?
http://help.godaddy.com/article/4145
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.
Maybe try this?
http://help.godaddy.com/article/4145
我的问题是我在网络根目录中有另一个 favicon.ico。
如果您在模板目录“/template/favicon.ico”中有一个网站图标,而在“/favicon.ico”中有另一个网站图标,即使您在模板文件夹中使用了网站图标的链接,Firefox 也会使用根目录中的网站图标。 解决方案是删除根目录中的图标。
我当前的firefox版本是58.0b6(Quantum)。
My problem was that I had another favicon.ico in a web root directory.
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.
My current version of firefox is 58.0b6 (Quantum).
所以刚刚遇到了 Firefox v70.0.1 中未显示网站图标的问题。
现在,这可能只会成为极少数人的问题,并且很可能只有当您修改了 FF 中的 about:config 设置时,
这个问题对我来说是设置隐私。在某些网站上,resistfingerprinting 设置为 true,这会阻止网站图标。
我注意到的另一个问题以及导致我找出问题原因的原因是在我创建上传图像的网站上使用 dropzone.js 时显示了空白预览。预览是 base64 编码的,因此被阻止。
就像我说的,对于大多数人来说很可能不会成为问题,但想将其发布到某个地方,这样它可能会帮助其他可能面临与我类似问题的人。
在此处查看更多信息:https://wiki.mozilla.org/Security/Fingerprinting
此处: https://bugzilla.mozilla.org/show_bug.cgi?id=1452391
So just had an issue with favicons not showing in 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:config settings in FF
This issue for me was the setting privacy.resistfingerprinting was set to true on some sites this will block favicons.
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.
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
And Here: https://bugzilla.mozilla.org/show_bug.cgi?id=1452391
我不是一名程序员,但我遇到了类似的问题,这是最终对我有用的简单事情......
我管理几个简单的网站,但 Firefox 拒绝加载一个特定网站的图标。我上网查了一下,尝试了我能理解的一切。什么都没起作用。该代码与其他图标运行良好的网站完全相同(实际上是复制的)。
最终我意识到,也许 Firefox 不喜欢我以前到达那里的路径。该网站是一个转发的 URL,托管在我自己的域上。 (即个人域名是 myplace.ca,无法加载的图标是注册 URL Something.com 的一部分,该 URL 实际上位于 myplace.ca/PutItHere/)如果我使用注册 URL (something.com),则不会出现图标。如果我在浏览器中使用真实路径,突然出现favicon!我所要做的就是为绝对路径而不是注册域名添加书签!
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.
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!
我还发现,如果引用完整的 URL 路径,则可能需要引用带有 www 的 URL。放入其中,否则可能无法加载。
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.
这是 2017 年的事。 Firefox 没有拾取我名为“favicon-32x32.png”的图标,而 Chrome 却显示了。 我将文件名更改为“favicon.png”,并按照上面显示的方式刷新,效果很好。我正在使用:
火狐版本55.0
Chrome 版本 60.0
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