从Chrome缓存中获取Favicon

问题描述

某些网站已更新favicon.ico,旧网址提供的文件带有新图标。

但是Chrome在大多数标签中仍显示旧图标。如何获取旧图标并将其另存为图像?

前段时间的chrome://cache/ URL允许保存缓存的文件,但现在已从Chrome中删除。有替代品吗?

解决方法

根据this answer个收藏夹图标存储在文件中

win:   %LocalAppData%\Google\Chrome\User Data\Default\Favicons
mac:   ${user.home}/Library/Application Support/Google/Chrome/Default/Favicons

此文件是sqlite数据库,您可以使用DB Browser for SQLite复制并打开它。

获取图标的查询是

select f.url,b.*
from favicons f inner join favicon_bitmaps b on f.id = b.icon_id
where f.url like '%domain-of-the-site%'

image_data列将包含带有图标的blob。您可以在右侧面板中看到预览,并可以使用其上方的工具栏将其保存到文件中:

screenshot