Files
bitvid/todo/TODO_2026-02-20_innerhtml.md
T
google-labs-jules[bot]andPR0M3TH3AN f9f23c0d08 [security] replace innerHTML usages in js/ui/components/ShareNostrModal.js — convert to safe DOM APIs
- Replace template `innerHTML` with `DOMParser`
- Replace SVG `innerHTML` with `createElementNS`
- Replace `innerHTML = ""` with `replaceChildren()`
- Update `check-innerhtml` baseline

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-20 20:07:34 +00:00

592 B

TODO: innerHTML Migration for ShareNostrModal.js

  • L107: wrapper.innerHTML = html; (Template loading)
    • Strategy: Use new DOMParser().parseFromString(html, 'text/html') and append children to wrapper.
  • L274: this.relayPills.innerHTML = ""; (Clearing content)
    • Strategy: this.relayPills.replaceChildren(); or textContent = "" (replaceChildren is preferred for performance).
  • L300: removeButton.innerHTML = '<svg ...>...</svg>'; (SVG Icon)
    • Strategy: Create SVG elements using document.createElementNS("http://www.w3.org/2000/svg", "svg") and children.