From f22a073ee46f492637494f433bcebfd79964ee42 Mon Sep 17 00:00:00 2001 From: Malte Bublitz Date: Mon, 3 Oct 2022 05:36:07 +0200 Subject: [PATCH] new-tab: Redirect gemini:// zu Web-Proxy --- js/new-tab.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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/"); } }); }; -- 2.30.2