From 167a4f3f982776382812c1cf1de97d1f071fe7f0 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sun, 13 Mar 2022 12:19:32 +0100 Subject: [PATCH] [XSS] Enable "Clear XSS Choices" button only if some item is selected. --- src/ui/ui.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/ui.js b/src/ui/ui.js index 6191c54..445478e 100644 --- a/src/ui/ui.js +++ b/src/ui/ui.js @@ -197,6 +197,9 @@ var UI = (() => { button = choicesUI.appendChild(document.createElement("button")); button.textContent = _("XSS_clearUserChoices"); } + (list.onchange = () => { + button.disabled = list.selectedOptions.length === 0; + })(); button.onclick = () => { let xssUserChoices = UI.xssUserChoices; for (let o of [...list.selectedOptions]) {