From 0aacfa705e307286aa87861de5442785b1b51f65 Mon Sep 17 00:00:00 2001 From: hackademix Date: Fri, 12 Apr 2019 01:26:11 +0200 Subject: More consistent and efficient blacklisting. --- html/display_panel/content/main_panel.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'html') diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js index 75de6aa..32d1bda 100644 --- a/html/display_panel/content/main_panel.js +++ b/html/display_panel/content/main_panel.js @@ -59,7 +59,7 @@ document.querySelector("#info").addEventListener("click", e => { setTimeout(close, 100); return; } - if (!button.tagName === "BUTTON") button = button.closest("button"); + if (button.tagName !== "BUTTON") button = button.closest("button"); if (button.matches(".toggle-source")) { let parent = button.parentNode; if (!parent.querySelector(".source").textContent) { @@ -199,12 +199,17 @@ function refreshUI(report) { } if (siteStatus && siteStatus !== "unknown") { + let siteContainer = document.querySelector("#site"); let statusLabel = siteStatus; - if (listedSite && listedSite !== report.site) statusLabel += ` via ${listedSite}`; - let status = document.querySelector("#site .status"); + if (listedSite && listedSite !== report.site) { + statusLabel += ` via ${listedSite}`; + siteContainer.querySelector(".forget").disabled = true; + } + let status = siteContainer.querySelector(".status"); status.classList.add(siteStatus); - document.querySelector("#site .status").textContent = statusLabel; - document.querySelector("#site .forget").disabled = true; + status.textContent = statusLabel; + } else { + document.querySelector("#site .status").textContent = ""; } let noscript = scriptsCount === 0; -- cgit v1.2.3