Firefox 不显示网站图标

本文介绍了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 不显示网站图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,WP2

admin_action_{$_REQUEST[‘action’]}

do_action( "admin_action_{$_REQUEST[‘action’]}" )动作钩子::在发送“Action”请求变量时激发。Action Hook: Fires when an ‘action’ request variable is sent.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$_REQUEST['action']引用从GET或POST请求派生的操作。源码(Source)更新版本源码位置使用被使用2.6.0 wp-admin/admin.php:...

日期:2020-09-02 17:44:16 浏览:1169

admin_footer-{$GLOBALS[‘hook_suffix’]}

do_action( "admin_footer-{$GLOBALS[‘hook_suffix’]}", string $hook_suffix )操作挂钩:在默认页脚脚本之后打印脚本或数据。Action Hook: Print scripts or data after the default footer scripts.目录锚点:#说明#参数#源码说明(Description)钩子名的动态部分,$GLOBALS['hook_suffix']引用当前页的全局钩子后缀。参数(Parameters)参数类...

日期:2020-09-02 17:44:20 浏览:1070

customize_save_{$this->id_data[‘base’]}

do_action( "customize_save_{$this-&gt;id_data[‘base’]}", WP_Customize_Setting $this )动作钩子::在调用WP_Customize_Setting::save()方法时激发。Action Hook: Fires when the WP_Customize_Setting::save() method is called.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_data...

日期:2020-08-15 15:47:24 浏览:806

customize_value_{$this->id_data[‘base’]}

apply_filters( "customize_value_{$this-&gt;id_data[‘base’]}", mixed $default )过滤器::过滤未作为主题模式或选项处理的自定义设置值。Filter Hook: Filter a Customize setting value not handled as a theme_mod or option.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分,$this->id_date['base'],指的是设置...

日期:2020-08-15 15:47:24 浏览:898

get_comment_author_url

过滤钩子:过滤评论作者的URL。Filter Hook: Filters the comment author’s URL.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/comment-template.php:32610...

日期:2020-08-10 23:06:14 浏览:930

network_admin_edit_{$_GET[‘action’]}

do_action( "network_admin_edit_{$_GET[‘action’]}" )操作挂钩:启动请求的处理程序操作。Action Hook: Fires the requested handler action.目录锚点:#说明#源码说明(Description)钩子名称的动态部分$u GET['action']引用请求的操作的名称。源码(Source)更新版本源码位置使用被使用3.1.0 wp-admin/network/edit.php:3600...

日期:2020-08-02 09:56:09 浏览:877

network_sites_updated_message_{$_GET[‘updated’]}

apply_filters( "network_sites_updated_message_{$_GET[‘updated’]}", string $msg )筛选器挂钩:在网络管理中筛选特定的非默认站点更新消息。Filter Hook: Filters a specific, non-default site-updated message in the Network admin.目录锚点:#说明#参数#源码说明(Description)钩子名称的动态部分$_GET['updated']引用了非默认的...

日期:2020-08-02 09:56:03 浏览:864

pre_wp_is_site_initialized

过滤器::过滤在访问数据库之前是否初始化站点的检查。Filter Hook: Filters the check for whether a site is initialized before the database is accessed.目录锚点:#源码源码(Source)更新版本源码位置使用被使用 wp-includes/ms-site.php:93910...

日期:2020-07-29 10:15:38 浏览:833

WordPress 的SEO 教学:如何在网站中加入关键字(Meta Keywords)与Meta 描述(Meta Description)?

你想在WordPress 中添加关键字和meta 描述吗?关键字和meta 描述使你能够提高网站的SEO。在本文中,我们将向你展示如何在WordPress 中正确添加关键字和meta 描述。为什么要在WordPress 中添加关键字和Meta 描述?关键字和说明让搜寻引擎更了解您的帖子和页面的内容。关键词是人们寻找您发布的内容时,可能会搜索的重要词语或片语。而Meta Description则是对你的页面和文章的简要描述。如果你想要了解更多关于中继标签的资讯,可以参考Google的说明。Meta 关键字和描...

日期:2020-10-03 21:18:25 浏览:1726

谷歌的SEO是什么

SEO (Search Engine Optimization)中文是搜寻引擎最佳化,意思近于「关键字自然排序」、「网站排名优化」。简言之,SEO是以搜索引擎(如Google、Bing)为曝光媒体的行销手法。例如搜寻「wordpress教学」,会看到本站的「WordPress教学:12个课程…」排行Google第一:关键字:wordpress教学、wordpress课程…若搜寻「网站架设」,则会看到另一个网页排名第1:关键字:网站架设、架站…以上两个网页,每月从搜寻引擎导入自然流量,达2万4千:每月「有机搜...

日期:2020-10-30 17:23:57 浏览:1308