fix: safeHTML live NodeList issue + expanded common words

Fixed safeHTML in all three files — template.content.childNodes and
doc.body.childNodes are live NodeLists that shrink as nodes are moved.
Using Array.from() to create a static copy before spreading into
replaceChildren().

Expanded proper noun common words filter with ~500 additional verbs,
nouns, and adjectives (generate, design, manage, process, account,
button, dashboard, etc.) to prevent false PPI flags on titles,
headings, and UI button labels.

https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
Claude
2026-03-27 02:45:52 +00:00
parent 6192886b92
commit 66f408713c
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ const $ = (sel) => document.querySelector(sel);
// --- Safe innerHTML replacement (AMO-compliant) ---
function safeHTML(el, html) {
const doc = new DOMParser().parseFromString(html, 'text/html');
el.replaceChildren(...doc.body.childNodes);
el.replaceChildren(...Array.from(doc.body.childNodes));
}
document.addEventListener('DOMContentLoaded', async () => {