Conversation
Replaces innerHTML-based shortcut rendering with direct DOM manipulation for improved security and maintainability. Updates getLogoHtml to return DOM elements instead of HTML strings, and adjusts all usages accordingly.
📝 WalkthroughWalkthroughReplaced HTML string templating in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@scripts/shortcuts.js`:
- Around line 257-282: Add decorative accessibility attributes to all created
logo elements: for every HTMLImageElement instance (the GitHub shortcut img and
the Google favicon img) set img.alt = "" and img.setAttribute("aria-hidden",
"true"); and for the preset SVG case, after creating wrapper and before
returning wrapper.firstElementChild, if that node is an Element set
wrapper.firstElementChild.setAttribute("aria-hidden", "true") and
wrapper.firstElementChild.setAttribute("focusable", "false") (optional) so
screen readers ignore these decorative logos.
Extracted shortcut element creation into a new createShortcutElement function to reduce code duplication and improve maintainability. Updated renderShortcut and shortcut list rendering to use the new helper.
Added empty alt attributes to dynamically created img elements for accessibility and to prevent screen readers from reading unnecessary content.
|
Uhhh I have a trip tomorrow. Well. Let's see if i can check now. |
|
@itz-rj-here waiting for your approval before merging |
itz-rj-here
left a comment
There was a problem hiding this comment.
Works fine with no issues
Thanks! Hopefully you have verified for offline case too. |
Lol i literally turned off the wifi 💀 |

📌 Description
Display offline shortcut icon when offline and not icon in cache
🎨 Visual Changes (Screenshots / Videos)
🔗 Related Issues
✅ Checklist
Overview
This PR refactors shortcut icon rendering in scripts/shortcuts.js to use explicit DOM element creation, centralizes shortcut DOM construction, adds favicon error fallback to a local offline icon, and sets empty alt attributes on dynamically created img elements to avoid noisy screen reader output. The change removes innerHTML-based templating for shortcuts and standardizes DOM-based insertion.
Changes
Impact
Files Modified
Notes