File tree Expand file tree Collapse file tree 10 files changed +80
-9
lines changed
Expand file tree Collapse file tree 10 files changed +80
-9
lines changed Original file line number Diff line number Diff line change 598598 "favicon_service" : " Favicon-Dienst" ,
599599 "favicon_service_desc" : " Dienst zum Abrufen von Website-Symbolen auswählen" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " Lokal abrufen" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " Lokal abrufen" ,
603605 "editor" : {
604606 "show_script_list" : " Skriptliste anzeigen" ,
605607 "hide_script_list" : " Skriptliste ausblenden"
Original file line number Diff line number Diff line change 598598 "favicon_service" : " Favicon Service" ,
599599 "favicon_service_desc" : " Choose the service for fetching website icons" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " Local Fetch" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " Local Fetch" ,
603605 "editor" : {
604606 "show_script_list" : " Show Script List" ,
605607 "hide_script_list" : " Hide Script List"
Original file line number Diff line number Diff line change 598598 "favicon_service" : " Favicon サービス" ,
599599 "favicon_service_desc" : " ウェブサイトアイコンの取得サービスを選択" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " ローカル取得" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " ローカル取得" ,
603605 "editor" : {
604606 "show_script_list" : " スクリプトリストを表示" ,
605607 "hide_script_list" : " スクリプトリストを非表示"
Original file line number Diff line number Diff line change 598598 "favicon_service" : " Сервис Favicon" ,
599599 "favicon_service_desc" : " Выберите сервис для получения значков сайтов" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " Локальное получение" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " Локальное получение" ,
603605 "editor" : {
604606 "show_script_list" : " Показать список скриптов" ,
605607 "hide_script_list" : " Скрыть список скриптов"
Original file line number Diff line number Diff line change 598598 "favicon_service" : " Dịch vụ Favicon" ,
599599 "favicon_service_desc" : " Chọn dịch vụ để lấy biểu tượng trang web" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " Lấy cục bộ" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " Lấy cục bộ" ,
603605 "editor" : {
604606 "show_script_list" : " Hiển thị danh sách script" ,
605607 "hide_script_list" : " Ẩn danh sách script"
Original file line number Diff line number Diff line change 598598 "favicon_service" : " 图标服务" ,
599599 "favicon_service_desc" : " 选择获取网站图标的服务" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " 本地获取" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " 本地获取" ,
603605 "editor" : {
604606 "show_script_list" : " 显示脚本列表" ,
605607 "hide_script_list" : " 隐藏脚本列表"
Original file line number Diff line number Diff line change 598598 "favicon_service" : " 圖示服務" ,
599599 "favicon_service_desc" : " 選擇取得網站圖示的服務" ,
600600 "favicon_service_scriptcat" : " ScriptCat" ,
601- "favicon_service_local" : " 本地取得" ,
602601 "favicon_service_google" : " Google" ,
602+ "favicon_service_duckduckgo" : " DuckDuckGo" ,
603+ "favicon_service_icon-horse" : " Icon Horse" ,
604+ "favicon_service_local" : " 本地取得" ,
603605 "editor" : {
604606 "show_script_list" : " 顯示腳本列表" ,
605607 "hide_script_list" : " 隱藏腳本列表"
Original file line number Diff line number Diff line change @@ -338,6 +338,8 @@ function Setting() {
338338 >
339339 < Select . Option value = "scriptcat" > { t ( "favicon_service_scriptcat" ) } </ Select . Option >
340340 < Select . Option value = "google" > { t ( "favicon_service_google" ) } </ Select . Option >
341+ < Select . Option value = "duckduckgo" > { t ( "favicon_service_duckduckgo" ) } </ Select . Option >
342+ < Select . Option value = "icon-horse" > { t ( "favicon_service_icon-horse" ) } </ Select . Option >
341343 < Select . Option value = "local" > { t ( "favicon_service_local" ) } </ Select . Option >
342344 </ Select >
343345 </ div >
Original file line number Diff line number Diff line change @@ -195,16 +195,71 @@ export async function fetchIconByDomain(domain: string): Promise<string[]> {
195195}
196196
197197/**
198- * 根据服务类型获取favicon URL列表
198+ * 根据服务类型获取 favicon URL 列表
199+ *
200+ * 各服务说明(包含尺寸、限制、收费、国内可用性等):
199201 */
200202export async function fetchIconByService ( domain : string , service : FaviconService ) : Promise < string [ ] > {
201203 switch ( service ) {
202204 case "scriptcat" :
205+ /**
206+ * ScriptCat 图标服务
207+ * - 尺寸:支持 sz 参数(如 16 / 32 / 64 / 128)
208+ * - 限制:暂无公开限流说明,小规模使用稳定
209+ * - 收费:免费
210+ * - 中国访问:✅ 国内可正常访问(国内服务)
211+ * - 缓存:可长期缓存(返回稳定)
212+ * - 特点:适合国内项目,速度快
213+ */
203214 return [ `https://ext.scriptcat.org/api/v1/open/favicons?domain=${ encodeURIComponent ( domain ) } &sz=64` ] ;
215+
204216 case "google" :
217+ /**
218+ * Google S2 Favicon 服务
219+ * - 尺寸:支持 sz=16~256(常用 16/32/64)
220+ * - 限制:无官方文档,存在隐性限流
221+ * - 收费:免费
222+ * - 中国访问:⚠️ 基本不可用
223+ * - 缓存:强烈建议缓存(避免请求失败)
224+ * - 特点:质量高,命中率高
225+ */
205226 return [ `https://www.google.com/s2/favicons?domain=${ encodeURIComponent ( domain ) } &sz=64` ] ;
227+
228+ case "duckduckgo" :
229+ /**
230+ * DuckDuckGo 图标服务
231+ * - 尺寸:固定(通常 64x64 或 ico 原始尺寸)
232+ * - 限制:无官方说明
233+ * - 收费:免费
234+ * - 中国访问:⚠️ 不稳定 / 偶尔失败
235+ * - 缓存:建议缓存
236+ * - 特点:简单直接,返回 ico
237+ */
238+ return [ `https://icons.duckduckgo.com/ip3/${ encodeURI ( domain ) } .ico` ] ;
239+
240+ case "icon-horse" :
241+ /**
242+ * Icon Horse
243+ * - 尺寸:自动适配(返回较高清 ico)
244+ * - 限制:未公开限流策略
245+ * - 收费:免费(轻量使用)
246+ * - 中国访问:⚠️ 较慢或不稳定
247+ * - 缓存:建议缓存
248+ * - 特点:质量较好,支持 fallback
249+ */
250+ return [ `https://icon.horse/icon/${ encodeURI ( domain ) } ` ] ;
251+
206252 case "local" :
207253 default :
254+ /**
255+ * 本地解析 favicon
256+ * - 尺寸:取决于网站(可能多尺寸)
257+ * - 限制:需要自行实现抓取逻辑
258+ * - 收费:无(本地逻辑)
259+ * - 中国访问:✅ 完全可控
260+ * - 缓存:强烈建议缓存
261+ * - 特点:最可靠但实现成本高
262+ */
208263 return await fetchIconByDomain ( domain ) ;
209264 }
210265}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export type CloudSyncConfig = {
2020 params : { [ key : string ] : any } ;
2121} ;
2222
23- export type FaviconService = "scriptcat" | "local " | "google " ;
23+ export type FaviconService = "scriptcat" | "google " | "duckduckgo" | "icon-horse" | "local ";
2424
2525export type CATFileStorage = {
2626 filesystem : FileSystemType ;
You can’t perform that action at this time.
0 commit comments