Firefox 不显示网站图标 [英] favicon not displayed by Firefox

查看:82
本文介绍了Firefox 不显示网站图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确实知道这个问题仅在这个网站上就被问过至少一千次,但我已经阅读了很多这样的话题,我确实认为自己知识渊博,很少问任何问题,相反更喜欢做我自己的研究.

然而,这个问题太奇怪了,没有希望得到真正的启发(因为这个问题已经被讨论得如此频繁,但我仍然无法从阅读那里受益),这是我的问题:

favicon.ico 存在,并且(本地托管的开发网站)http://website/favicon.ico 显示正确的图标.它的大小仅为 198 字节,因此我在 Firefox 的 about:config 中发现的大小限制为 1024 字节.根据网络上的收藏夹图标的智慧,当页面中没有任何内容时,浏览器应该自行请求收藏夹图标.但是,我的 apache 日志清楚地显示 Firefox (9.01) 甚至从未要求它.

下一步:当我添加

我仍然没有得到网站图标.

下一步:当我改为使用

(注意尾随的?")我突然DO 得到一个收藏夹图标.但这不可能是缓存问题!首先,我已经清除了缓存,其次,正如我上面提到的,我已经通过其 URL http://website/favicon.ico

成功地将图标文件加载到 Firefox 中

我无法解释 Firefox 的这种行为.顺便说一下,Chrome 会显示正确的网站图标.

这是我的页眉:

<头><meta charset="utf-8"><link rel="快捷图标" href="/favicon.ico?"/>...

只要我至少附加?"在ico"之后它起作用了.

这是请求图标时服务器发送的内容,因为有些人要求这样做.我不知道为什么这会有用,因为 a) 我说每次测试我的缓存都是空的(也用 about:cache 检查),并且 b) 我说服务器甚至从来没有被要求提供文件不显示. Firefox 只是不询问?"- 缓存为空!仅当我使用附加的?"时,请求才会显示在 apache 日志中.

日期 2011 年 12 月 23 日星期五 12:53:22 GMT服务器 Apache/2.2.20 (Ubuntu)上次修改时间 2011 年 12 月 23 日星期五 12:02:49 GMTEtag12c07fe-c6-4b4c132190e30"接受范围字节内容长度 198内容类型图像/x 图标

解决方案

首先,通过直接加载网站图标 URL(将其放入浏览器的 URL 栏)并强制刷新它.如果那样做,就不需要下面复杂的解决方案了.


<小时>

重要提示:

我原来的问题不可能是缓存问题:首先,我确实清除了缓存,其次,正如我上面提到的,我已经成功加载了通过其 URL http://website/favicon.ico

将图标文件导入 Firefox

所以我do(确实)在直接加载时在浏览器中获得了正确的图标!但我仍然(有)错误的图标显示为favicon".直接加载图标文件是(或曾经)独立在实际图标位置的显示(当然,第一次加载时除外).

但是,如果只有缓存问题并且强制刷新适用于您,那么这个问题/问题不是您的问题!而且您的回答不是这个问题的答案.

人们不应该忽视事实.当您被大量已经回答和/或无用的问题轰炸时,问题的质量会受到影响,而且存档也会受到影响.我不得不与仍然坚持强制刷新是答案的人作斗争,这真是太神奇了!

<小时>


注意:您可以像 StackOverflow 一样使用缓存破坏器 URL 来完全避免这个问题,它们的图标 URL 以 .../img/favicon.ico?v= 结尾4f32ecc8f43d.

如果正常的缓存清除措施失败(就像他们对我所做的那样)在这里给出答案:

我开始怀疑 Firefox 将网站图标缓存与其他一切分开 - 这是与观察到的行为相匹配的唯一解释.所以我用谷歌搜索确认并找到了上面的网址.接下来,我将尝试清除那个特定的额外缓存,看看会发生什么.

更新 - 已解决:在使用SQLite Manager"Firefox 插件删除网站图标缓存后,一切正常.

所以秘密是 Firefox 中 FAVICONS 的 EXTRA (sqlite) CACHE,它没有被常规的清除缓存"命令清除.

2017 年 3 月更新:我检查了这个 Firefox 附加组件以及下面这个答案中建议的独立应用以及两者做这份工作.根据其 Github 项目页面,SQLite Manager 附加组件最后一次更新是大约 2 年前,但它仍然可以在这种情况下完成它所需要的.已经分叉该项目的人 提供了更新,但这只是旁白.

I DO know this question has been asked at least a thousand times in this website alone, but I HAVE read many of those threads, I DO consider myself very knowledgeable and rarely ever ask anything, instead prefer to do my own research.

However, THIS issue is so strange, without hope for real enlightenment (since this question HAS been discussed so often and still I could not benefit from reading there), here is my issue:

favicon.ico exists, and (locally hosted development website) http://website/favicon.ico displays the correct icon. Its size is a mere 198 Bytes, so the size limit I found in Firefox's about:config of 1024 Bytes is adhered to. According to the wisdom on favicons on the web the browser should ask for favicons on its own when there is nothing in the of the page. However, my apache log clearly shows Firefox (9.01) never even asks for it.

Next: when I add

<link rel="shortcut icon" href="/favicon.ico">

I still don't get a favicon.

Next: when I instead use

<link rel="shortcut icon" href="/favicon.ico?">

(note the trailing "?") I suddenly DO get a favicon. BUt it cannot be a cache issue! First, I have cleared the cache, second, as I mentioned above, I already successfully loaded the icon file into Firefox through its URL http://website/favicon.ico

I am unable to explain this behavior of Firefox. Chrome shows the correct favicon, by the way.

This is my page head:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/favicon.ico?" />
</head>
...

As soon as I append at least the "?" after "ico" it works.

Here is what the server sends when the icon is requested, since some have asked for this. I have no idea why this would be useful, since a) I said my cache was empty for each test (checked with about:cache too), and b) I said the server is never even asked for the file when it does not show up. Firefox just does not ask without the "?" - with cache empty! The request shows up in the apache log ONLY when I use the appended "?".

Date    Fri, 23 Dec 2011 12:53:22 GMT
Server  Apache/2.2.20 (Ubuntu)
Last-Modified   Fri, 23 Dec 2011 12:02:49 GMT
Etag    "12c07fe-c6-4b4c132190e30"
Accept-Ranges   bytes
Content-Length  198
Content-Type    image/x-icon

解决方案

First, make sure you don't have a "normal" cache problem by loading the favicon URL directly (put it into the browser's URL bar) and force-refreshing it. If that does the job, no need for the complicated solution below.



IMPORTANT:

My original problem cannot have been a cache issue: First, I did clear the cache, second, as I mentioned above, I already successfully loaded the icon file into Firefox through its URL http://website/favicon.ico

So I do (did) get the right icon in the browser when loaded directly! But I still have (had) the wrong icon displayed as "favicon". Loading the icon file directly is (or was) independent of the display in the actual favicon location (except for when it is loaded for the very first time of course).

However, if you only have a cache issue and force-refresh works for your than this question/issue is NOT yours! And your answer isn't an answer for this issue.

People should not ignore facts. When you are bombarded with lots of already answered and/or useless questions the quality of the question suffers for the moment and for the archive too. It is amazing how I have to fight with people who still insist that a force-refresh is the answer!



Note: You can avoid this issue entirely by using a cache-buster URL just like StackOverflow does, their favicon URL ends in .../img/favicon.ico?v=4f32ecc8f43d.

If normal cache clearing measures fail (just like they did for me) an answer is given here: "Clearing All Favicons From Firefox 3 Cache [How-To]" -- and here is an archive.org version of the link (probably slower, but it won't go away).

The steps from that page reproduced here:

  1. Install the Firefox add-on SQLite Manager
  2. Launch it from Tools -> SQLite Manager
  3. Click the "Database" menu item (top left) and select "Connect Database", enter %APPDATA%MozillaFirefox
  4. Open the Profiles folder and go to the profile you use
  5. Select places.sqlite as the database file to edit (Firefox 61 and later: favicons.sqlite)
  6. Either choose the moz_favicons table. From the right-click context menu use "Empty table", do not use "Drop table" (the table must be there) or use the right-click context menu over the data and select "Delete" over only the one entry that you want to remove (see screenshot below)

I started suspecting that Firefox caches favicons separate from everything else - it was the only explanation matching the observed behavior. So I googled for confirmation and found the above URL. Next I'll try clearing that particular extra cache and see what happens.

UPDATE - SOLVED: After deleting the favicon cache using the "SQLite Manager" Firefox add-on all works as it should.

So the secret was the EXTRA (sqlite) CACHE FOR FAVICONS in Firefox, WHICH IS NOT CLEARED BY THE REGULAR "Clear Cache" command.

Update March 2017: I checked this Firefox add-on and also the standalone app suggested in this answer below and both do the job. The SQLite Manager add-on was last updated ~2 years ago according to its Github project page, but it still does what it's needed for in this context. There are updates available from people who have forked the project, but that is just an aside.

这篇关于Firefox 不显示网站图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆