diff --git a/history-deleter/history.js b/history-deleter/history.js index 6bafabe..c9d1949 100644 --- a/history-deleter/history.js +++ b/history-deleter/history.js @@ -14,7 +14,10 @@ function set_domain(domain) { } function no_history(hostname) { - document.getElementById('history').innerHTML = `No history for ${hostname}.`; + var history_text = document.getElementById('history'); + while(history_text.firstChild) + history_text.removeChild(history_text.firstChild); + history_text.textContent = `No history for ${hostname}.`; } // When the page is loaded find the current tab and then use that to query diff --git a/navigation-stats/popup.js b/navigation-stats/popup.js index b49cb1d..2800d36 100644 --- a/navigation-stats/popup.js +++ b/navigation-stats/popup.js @@ -14,7 +14,8 @@ chrome.storage.local.get("hostNavigationStats", results => { } let listEl = document.querySelector("ul"); - listEl.innerHTML = ""; + while(listEl.firstChild) + listEl.removeChild(listEl.firstChild); const MAX_ITEMS = 5; for (let i=0; i < sortedHostnames.length; i++) {