diff --git a/popup.js b/popup.js index f042beb..5a05960 100644 --- a/popup.js +++ b/popup.js @@ -51,6 +51,10 @@ async function loadBreezeWikiOptions() { } // Populate dropdown selection of hosts const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); + while (breezewikiHostSelect.firstChild) { + // Remove any existing options + breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild); + } for (var i = 0; i < breezewikiHosts.length; i++) { let option = document.createElement('option'); option.value = breezewikiHosts[i].instance; @@ -84,6 +88,10 @@ async function loadBreezeWikiOptions() { } // Populate dropdown selection of hosts const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); + while (breezewikiHostSelect.firstChild) { + // Remove any existing options + breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild); + } for (var i = 0; i < hostOptions.length; i++) { let option = document.createElement('option'); option.value = hostOptions[i].instance; diff --git a/settings.js b/settings.js index fa21f59..635ea55 100644 --- a/settings.js +++ b/settings.js @@ -80,6 +80,10 @@ async function loadBreezeWikiOptions() { } // Populate dropdown selection of hosts const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); + while (breezewikiHostSelect.firstChild) { + // Remove any existing options + breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild); + } for (var i = 0; i < breezewikiHosts.length; i++) { let option = document.createElement('option'); option.value = breezewikiHosts[i].instance; @@ -113,6 +117,10 @@ async function loadBreezeWikiOptions() { } // Populate dropdown selection of hosts const breezewikiHostSelect = document.getElementById('breezewikiHostSelect'); + while (breezewikiHostSelect.firstChild) { + // Remove any existing options + breezewikiHostSelect.removeChild(breezewikiHostSelect.lastChild); + } for (var i = 0; i < hostOptions.length; i++) { let option = document.createElement('option'); option.value = hostOptions[i].instance;