diff --git a/cmd/age-keyserver/templates/home.html b/cmd/age-keyserver/templates/home.html index 3e8a603..5eff1a8 100644 --- a/cmd/age-keyserver/templates/home.html +++ b/cmd/age-keyserver/templates/home.html @@ -115,6 +115,21 @@
Error looking up key.
'; } }); + + function initLookupFromQuery() { + const params = new URLSearchParams(document.location.search); + const emailParam = params.get("email"); + if (emailParam !== null) { + document.getElementById('lookup-email').value = emailParam; + document.getElementById('lookup-form').requestSubmit(); + } + } + + if (document.readyState === 'loading') { + document.addEventListener("DOMContentLoaded", initLookupFromQuery); + } else { + initLookupFromQuery(); + }