oops, don't use += on document.cookie, also fix some css.
This commit is contained in:
parent
32cfc7676e
commit
4ff12abc79
2 changed files with 8 additions and 4 deletions
|
|
@ -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.
|
// 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");
|
await fetch("/editsession?id=" + sessionID + "&enableShuffling=0");
|
||||||
// Now save it in a cookie that expires in 72 hours.
|
// 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
|
// 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}`;
|
iframe.src = `/${getCookie("rammerhead-session")}/${url}`;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -180,12 +180,15 @@
|
||||||
if (newURL === "about:blank") return;
|
if (newURL === "about:blank") return;
|
||||||
let urlText = document.getElementById("url-text");
|
let urlText = document.getElementById("url-text");
|
||||||
if (urlText) {
|
if (urlText) {
|
||||||
if (preference === "rammerhead")
|
if (preference === "rammerhead") {
|
||||||
urlText.innerText = newURL.slice(
|
let newurl = newURL.slice(
|
||||||
newURL.indexOf("/" + getCookie("rammerhead-session")) +
|
newURL.indexOf("/" + getCookie("rammerhead-session")) +
|
||||||
getCookie("rammerhead-session").length +
|
getCookie("rammerhead-session").length +
|
||||||
2
|
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]);
|
else urlText.innerText = window.__uv$config.decodeUrl(newURL.split(__uv$config.prefix)[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,6 +191,7 @@ const { title, optionalPreloads } = Astro.props;
|
||||||
transition: opacity 250ms ease-in-out;
|
transition: opacity 250ms ease-in-out;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
#close-button {
|
#close-button {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue