diff --git a/ext/setup/script.js b/ext/setup/script.js index ee6d067e..baea92eb 100644 --- a/ext/setup/script.js +++ b/ext/setup/script.js @@ -5,25 +5,31 @@ document.addEventListener('DOMContentLoaded', () => { if(checkbox !== null && out_span !== null) { checkbox.disabled = true; out_span.innerHTML = '(testing...)'; + const test_url = document.body.getAttribute('data-base-href') + "/nicetest"; + console.log("NiceURL testing with", test_url); - fetch(document.body.getAttribute('data-base-href') + "/nicetest").then(response => { + fetch(test_url).then(response => { if(!response.ok) { checkbox.disabled = true; out_span.innerHTML = '(http error)'; + console.log("NiceURL test got HTTP error:", response.status, response.statusText); } else { response.text().then(text => { if(text === 'ok') { checkbox.disabled = false; out_span.innerHTML = '(test passed)'; + console.log("NiceURL test passed"); } else { checkbox.disabled = true; out_span.innerHTML = '(test failed)'; + console.log("NiceURL test got wrong content:", text); } }); } - }).catch(() => { + }).catch((e) => { checkbox.disabled = true; out_span.innerHTML = '(request failed)'; + console.log("NiceURL test hit an exception:", e); }); } });