favicon不会被Firefox显示 [英] favicon not displayed by Firefox

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

问题描述

我知道这个问题在这个网站上已经被问过至少一千次了,但是我已经阅读了很多这样的主题,我认为自己非常有知识,很少有人问任何问题,但是,这个问题太奇怪了,没有希望真正的启蒙(因为这个问题已经经常讨论了,我仍然无法获益从那里读),这里是我的问题:

favicon.ico存在,和(本地托管的开发网站) http:// website / favicon .ico 显示正确的图标。它的大小只有198字节,所以我在Firefox的about:config 1024字节中发现的大小限制是坚持的。根据网站上的图标,浏览器在网页上没有任何内容时,应该自行寻求网站图标。然而,我的apache日志清楚地显示Firefox(9.01)甚至从来没有要求它。



下一个:当我添加

 < link rel =快捷方式图标href =/ favicon.ico> 

我还没有收到图标。



下一步:当我使用

 < link rel =快捷图标href =/ favicon.ico? > 

(注意尾部的?)突然间我得到一个favicon 。它不能是缓存问题!首先,我已经清除了缓存,第二,正如我上面提到的,我已经成功地加载到Firefox的图标文件通过它的URL http://website/favicon.ico / p>

我无法解释Firefox的这种行为。 Chrome浏览器显示正确的图标。



这是我的页面头:

 <!doctype html> 
< html>
< head>
< meta charset =utf-8>
< link rel =快捷图标href =/ favicon.ico? />
< / head>
...

只要我追加至少?之后ico它的作品。



这是服务器发送请求图标时发送的,因为有些人已经要求这个。 我不知道为什么这将是有用的,因为a)我说我的缓存是空的每个测试(检查about:cache),和b)我说服务器甚至从来没有问过这个文件没有显示出来。 Firefox没有要求没有? - 缓存空了!当我使用附加的?。

 日期星期五,2011年12月23日12: 53:22 GMT 
服务器Apache / 2.2.20(Ubuntu)
上次修改时间2011年12月23日星期五12:02:49 GMT
Etag12c07fe-c6-4b4c132190e30
Accept-Ranges bytes
Content-Length 198
Content-Type image / x-icon


,方法是直接加载favicon网址(将其放入浏览器的网址列)并强制刷新它。如果这样做,不需要下面的复杂解决方案。







重要提示:



我的原始问题不能是缓存问题:首先, / em>清除缓存,第二,如上所述,我已经成功地将图标文件加载到Firefox通过它的URL http://website/favicon.ico



因此,我直接在浏览器中获取正确的图标!但是我仍然(有)显示为favicon的错误图标。直接加载图标文件在实际的图标位置(除了第一次加载的时间除外)是显示在独立的


但是,如果只有一个缓存问题,而强制刷新对你来说比这个问题/问题不是你的!而且你的回答并不是这个问题的答案。。

人们不应该忽视事实。当你被大量的已经回答和/或无用的问题轰炸时,问题的质量也会受到影响。



$ b我很想知道如何与那些仍然坚持强制刷新的人打架$ b


注意:您可以像StackOverflow一样使用cache-buster URL完全避免此问题,他们的图标网址结束于 ... / img / favicon.ico?v = 4f32ecc8f43d
$ b 清除措施失败(就像他们为我做的),答案在这里给出:



我开始怀疑Firefox缓存图标与所有其他内容分离 - 这是唯一的解释匹配观察到的行为。所以我google搜索确认,并找到上述网址。下一步,我将尝试清除特定的额外缓存,看看会发生什么。


$ b

更新 - 已解决:使用SQLite管理器Firefox插件的所有工作,因为它应该。

所以秘密是EXTRA(sqlite的)火狐中的FAVICONSCACHE,这是不清除的这个定期的清除缓存命令。



2017年3月更新:我检查了这个Firefox附加组件并且下面这个答案中提出的独立应用程序和都做这项工作。 SQLite管理器插件是根据它的 Github项目页面在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%\Mozilla\Firefox
  4. Open the Profiles folder and go to the profile you use
  5. Select places.sqlite as the database file to edit
  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.

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

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