accept urls without scheme

This commit is contained in:
Gianni Carafa
2023-11-03 08:24:57 +01:00
parent e3389d2df3
commit bf2529753d
2 changed files with 10 additions and 4 deletions

View File

@@ -159,8 +159,11 @@
});
document.getElementById('inputForm').addEventListener('submit', function (e) {
e.preventDefault();
const inputValue = document.getElementById('inputField').value;
window.location.href = '/' + inputValue;
let url = document.getElementById('inputField').value;
if (url.indexOf('http') === -1) {
url = 'https://' + url;
}
window.location.href = '/' + url;
return false;
});
</script>