feat: Favicon Fallback Handling & Offline Icon Support#99
feat: Favicon Fallback Handling & Offline Icon Support#99Rudresh-11 wants to merge 3 commits intoprem-k-r:mainfrom
Conversation
WalkthroughReplaces the legacy Google favicon endpoint with unavatar.io for hostname favicon resolution and adds explicit onerror handling that falls back to an offline SVG. Updates CHANGELOG to document the change. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)scripts/shortcuts.js(1 hunks)
🔇 Additional comments (1)
scripts/shortcuts.js (1)
258-266: Verify CSP permissions for inlineonerrorhandler before deploymentThe unavatar-based favicon URL plus
onerrorswap to./svgs/offline.svgis solid for fallback logic and avoids infinite loops viathis.onerror = null.However, MV3 extension manifests typically restrict inline event handlers (
onerror="...") via Content Security Policy. If this project enforces strict CSP, the fallback will silently fail and users will still see a broken icon. Confirm that yourmanifest.jsonexplicitly allowsunsafe-inlinein the script or default directive, or refactorgetLogoHtmlto attach theerrorlistener programmatically instead.
📌 Description
This PR introduces improved favicon handling for shortcuts.
The previous Google favicon endpoint returned blank or generic fallback icons, which prevented the offline indicator from displaying correctly.
This update implements a new detection mechanism and a more reliable fallback workflow.
Key changes:
getLogoHtml()without modifying external CSS or project structure.🎨 Visual Changes (Screenshots / Videos)
🔗 Related Issues
✅ Checklist
Summary by CodeRabbit
Bug Fixes
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.