Repository navigation
Conversation
Chrome reports `favIconUrl` in a separate onUpdated event after the page load completes, once the favicon download finishes. fetchIconUrl only retried once 100ms after `complete`, so sites with large or uncached favicons (e.g. movlyhub.com, seenr.app) always failed and the command was saved with the placeholder icon. - Keep listening for up to 3s after `complete` for favIconUrl - Fall back to the Google favicon service on timeout or failure - Stop removing the listener when an event arrives before the window is created, and catch up via tabs.get instead Refs #557 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pd1sH4nCJL33ibMb6Cy6p5
レビュー結果favicon の遅延通知を 検討事項
軽微な指摘
セキュリティ・パフォーマンス
指摘は軽微なものが中心で、全体として approve 相当です。 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
==========================================
+ Coverage 61.29% 61.54% +0.24%
==========================================
Files 311 311
Lines 31273 31299 +26
Branches 3683 3709 +26
==========================================
+ Hits 19170 19262 +92
+ Misses 12103 12037 -66 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #557
原因
fetchIconUrlはtabs.onUpdatedのstatus: "complete"を受けた時点でfavIconUrlを確認し、無ければ 100ms 後に1回だけ再確認していました。検証用拡張機能で
onUpdatedを計測したところ、Chrome は読み込み完了後に favicon をダウンロードし、その完了後に別イベントでfavIconUrlを通知しており、complete時点でfavIconUrlが入っているケースは1件もありませんでした。成否は favicon のダウンロード時間次第で、キャッシュの無いサイトや大きな favicon のサイトでは失敗し、
ICON_NOT_FOUNDが保存されていました。タイムアウト(5秒)や Cloudflare のチャレンジは原因ではありませんでした。変更内容
complete後も最大 3 秒onUpdatedを監視し、favIconUrlが届いた時点で確定するICON_NOT_FOUNDではなく Google favicon サービス(getGoogleFaviconUrl)の URL を返す%sやクエリが混ざらないよう、オリジンのみをencodeURIComponentして渡すwindows.createの解決前に他タブ等のonUpdatedが来ると、リスナーが外れて必ずタイムアウトになる潜在バグを修正(作成直後にtabs.getで状態を補完)chrome.fetchIconUrl.test.ts(FI-01〜09)、getGoogleFaviconUrlのテスト(GF-01〜02)を追加未対応(別途検討)
ICON_NOT_FOUNDで保存済みのコマンドは、検索 URL を再入力すれば再取得されますが、自動補完はしていませんテスト
yarn test(extension): 138 files / 1992 tests passtsc --noEmit,yarn lint: エラーなし🤖 Generated with Claude Code
https://claude.ai/code/session_01Pd1sH4nCJL33ibMb6Cy6p5