mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
[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]>
This commit is contained in:
1 parent
83247a0754
commit
f9f23c0d08
6 files changed
+105
-5
No files matched your search
@@ -0,0 +1,24 @@
|
||||
# innerHTML Migration Task: ShareNostrModal.js
|
||||
|
||||
**Date:** 2026-02-20
|
||||
**Agent:** innerhtml-migration-agent
|
||||
**Status:** Completed
|
||||
|
||||
## Migrated File
|
||||
* `js/ui/components/ShareNostrModal.js` (3 innerHTML assignments migrated)
|
||||
|
||||
## Changes
|
||||
1. **Template Loading:** Replaced `wrapper.innerHTML = html` with `DOMParser` logic.
|
||||
2. **Clearing Content:** Replaced `this.relayPills.innerHTML = ""` with `replaceChildren()`.
|
||||
3. **SVG Icon:** Replaced `removeButton.innerHTML = SVG` with `createElementNS`.
|
||||
|
||||
## Verification
|
||||
* `npm run lint` passed.
|
||||
* `npm run test:unit` passed.
|
||||
* `node scripts/check-innerhtml.mjs --report` confirmed count reduction (3 -> 0 for this file).
|
||||
* `scripts/check-innerhtml.mjs` baseline updated.
|
||||
|
||||
## Artifacts
|
||||
* `context/CONTEXT_2026-02-20_innerhtml.md`
|
||||
* `todo/TODO_2026-02-20_innerhtml.md`
|
||||
* `decisions/DECISIONS_2026-02-20_innerhtml.md`
|
||||
Reference in new issue
Block a user