mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +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,17 @@
|
||||
# Context: innerHTML Migration for ShareNostrModal.js
|
||||
|
||||
**Date:** 2026-02-20
|
||||
**Agent:** bitvid-innerhtml-migration-agent (via Jules)
|
||||
**Target File:** `js/ui/components/ShareNostrModal.js`
|
||||
**Reason:** High count (3 assignments). Contains static SVG injection and template loading.
|
||||
|
||||
**Environment:**
|
||||
- Node: v22.22.0
|
||||
- npm: 11.7.0
|
||||
|
||||
**Plan:**
|
||||
1. Analyze `innerHTML` assignments.
|
||||
2. Replace `wrapper.innerHTML = html` with `DOMParser` or similar safe parsing.
|
||||
3. Replace `this.relayPills.innerHTML = ""` with `replaceChildren()`.
|
||||
4. Replace `removeButton.innerHTML = SVG` with `createElementNS` or safe SVG construction.
|
||||
5. Verify with lint and tests.
|
||||
Reference in new issue
Block a user