From 4ff12abc79e6268117dd145b137a52d1fee2e864 Mon Sep 17 00:00:00 2001 From: wearrrrr Date: Sun, 25 Feb 2024 18:30:28 -0600 Subject: [PATCH] oops, don't use += on document.cookie, also fix some css. --- src/components/ProxyRegistrar.astro | 11 +++++++---- src/layouts/Layout.astro | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ProxyRegistrar.astro b/src/components/ProxyRegistrar.astro index 4135ce6..16be5a9 100644 --- a/src/components/ProxyRegistrar.astro +++ b/src/components/ProxyRegistrar.astro @@ -39,9 +39,9 @@ // Disable URL shuffling on rewrite, eventually I'll try and figure out how it works, but for now, it's disabled. await fetch("/editsession?id=" + sessionID + "&enableShuffling=0"); // Now save it in a cookie that expires in 72 hours. - document.cookie += `rammerhead-session=${sessionID}; max-age=${60 * 60 * 72}; path=/`; + document.cookie = `rammerhead-session=${sessionID}; max-age=${60 * 60 * 72}; path=/`; // Now add an origin_proxy cookie for our domain - document.cookie += `origin_proxy=${window.location.origin}; max-age=${60 * 60 * 72}; path=/`; + document.cookie = `origin_proxy=${window.location.origin}; max-age=${60 * 60 * 72}; path=/`; } iframe.src = `/${getCookie("rammerhead-session")}/${url}`; } else { @@ -180,12 +180,15 @@ if (newURL === "about:blank") return; let urlText = document.getElementById("url-text"); if (urlText) { - if (preference === "rammerhead") - urlText.innerText = newURL.slice( + if (preference === "rammerhead") { + let newurl = newURL.slice( newURL.indexOf("/" + getCookie("rammerhead-session")) + getCookie("rammerhead-session").length + 2 ); + if (newurl.length > 30) newurl = newurl.slice(0, 50) + "..."; + urlText.innerText = newurl; + } else urlText.innerText = window.__uv$config.decodeUrl(newURL.split(__uv$config.prefix)[1]); } } diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 3358e6a..51581aa 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -191,6 +191,7 @@ const { title, optionalPreloads } = Astro.props; transition: opacity 250ms ease-in-out; pointer-events: none; opacity: 0; + gap: 10px; } #close-button { padding: 5px;