From: Matt Corallo Date: Sat, 7 Sep 2024 17:28:44 +0000 (+0000) Subject: Support satsto.me/HRN directly X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=15cd58b2bd7583d231208f6295faf3b4f9915cb2;p=satsto.me Support satsto.me/HRN directly --- diff --git a/index.html b/index.html index 788bb2f..f66e922 100644 --- a/index.html +++ b/index.html @@ -316,15 +316,17 @@ // Do this before we load the modules to get the default value up quickly window.default_hrn = 'send.some@satsto.me'; window.url_set_hrn = 'send.some@satsto.me'; - if (document.getElementById("address").value === '') { - if (window.location.search.length > 1 && window.location.search[0] === "?") { - for (const pair of window.location.search.substring(1).split("&")) { - const key_value = pair.split("="); - if (key_value.length === 2 && key_value[0] === "name") { - window.url_set_hrn = key_value[1]; - } + if (window.location.pathname.length > 1 && window.location.pathname.indexOf("@") != -1) { + window.url_set_hrn = window.location.pathname.substring(1); + } else if (window.location.search.length > 1 && window.location.search[0] === "?") { + for (const pair of window.location.search.substring(1).split("&")) { + const key_value = pair.split("="); + if (key_value.length === 2 && key_value[0] === "name") { + window.url_set_hrn = key_value[1]; } } + } + if (document.getElementById("address").value === '') { document.getElementById("address").value = window.url_set_hrn; }