From: Malte Bublitz Date: Mon, 3 Oct 2022 03:36:07 +0000 (+0200) Subject: new-tab: Redirect gemini:// zu Web-Proxy X-Git-Url: https://git.rt3x.de/?a=commitdiff_plain;h=f22a073ee46f492637494f433bcebfd79964ee42;p=startseite.malte70.de.git new-tab: Redirect gemini:// zu Web-Proxy --- diff --git a/js/new-tab.js b/js/new-tab.js index 4085108..27a277b 100644 --- a/js/new-tab.js +++ b/js/new-tab.js @@ -34,9 +34,12 @@ window.onload = function() { */ document.querySelector("#search form").addEventListener('submit', (event) => { if (document.querySelector("input[type=search]").value.startsWith("http://") || document.querySelector("input[type=search]").value.startsWith("https://")) { - console.info('location.href = document.querySelector("input[type=search]").value;') + console.debug('location.href = document.querySelector("input[type=search]").value;') location.href = document.querySelector("input[type=search]").value; event.preventDefault(); + } elseif (document.querySelector("input[type=search]").value.startsWith("gemini://")) { + console.debug("Redirecting to Gemini Proxy…"); + location.href = 'https://portal.mozz.us/gemini/' + document.querySelector("input[type=search]").value.replace("gemini://", "https://portal.mozz.us/gemini/"); } }); };