From e3c73af436d515acc581178759022184043b772f Mon Sep 17 00:00:00 2001 From: Daniel Dada Date: Mon, 23 Jun 2025 15:31:57 +0300 Subject: [PATCH] fix: excame html in popup.js --- popup/popup.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/popup/popup.js b/popup/popup.js index c51dc52..525b5b8 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -12,6 +12,18 @@ let saveTimeout; let selectedCheckboxes = new Set(); let globalHighlightEnabled = true; +function escapeHtml(str) { + return str.replace(/[&<>"']/g, function (m) { + return ({ + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + })[m]; + }); +} + async function debouncedSave() { clearTimeout(saveTimeout); saveTimeout = setTimeout(async () => { @@ -79,7 +91,9 @@ async function load() { } function renderLists() { - listSelect.innerHTML = lists.map((list, index) => ``).join(""); + listSelect.innerHTML = lists.map((list, index) => + `` + ).join(""); listSelect.value = currentListIndex; updateListForm(); }