mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 21:02:28 +00:00
[security] replace innerHTML in RevertModal.js
Migrated `js/ui/components/RevertModal.js` to safe DOM APIs (`createElement`, `textContent`, `DOMParser`). Extracted rendering logic to `js/ui/components/revertModalRenderers.js`. Updated baseline in `scripts/check-innerhtml.mjs` (0 remaining usages). Updated tests to mock DOMParser. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
83587ea3ea
commit
f676fb2ff5
9 files changed
+1001
-621
No files matched your search
@@ -38,6 +38,7 @@ function installDom(html) {
|
||||
globalThis.CustomEvent = window.CustomEvent;
|
||||
globalThis.Event = window.Event;
|
||||
globalThis.Node = window.Node;
|
||||
globalThis.DOMParser = window.DOMParser;
|
||||
Object.defineProperty(globalThis, "navigator", {
|
||||
value: window.navigator,
|
||||
writable: true,
|
||||
@@ -64,6 +65,7 @@ function installDom(html) {
|
||||
delete globalThis.CustomEvent;
|
||||
delete globalThis.Event;
|
||||
delete globalThis.Node;
|
||||
delete globalThis.DOMParser;
|
||||
delete globalThis.navigator;
|
||||
delete globalThis.location;
|
||||
delete globalThis.KeyboardEvent;
|
||||
|
||||
Reference in new issue
Block a user