Preserve the path name for mirror links
This commit is contained in:
N-Pex 2025-12-22 13:23:43 +01:00
parent f41aec59bb
commit 47ebc55f80
4 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
"name": "keanuapp-weblite",
"version": "0.1.93",
"version": "0.1.94",
"private": true,
"scripts": {
"dev": "vite",

View file

@ -1,6 +1,6 @@
{
"name": "keanuapp-weblite",
"version": "0.1.92",
"version": "0.1.93",
"private": true,
"scripts": {
"dev": "vite",

View file

@ -34,7 +34,7 @@
function go() {
if (navigator.onLine) {
let url = "<!--MIRROR_URL-->/#/?migrate=1";
let url = "<!--MIRROR_URL-->" + window.location.pathname + "#/?migrate=1";
if (!url.includes("://")) {
url = window.location.protocol + "//" + url;
}
@ -72,7 +72,7 @@
} else if (data !== null && data.cmd == "migrationDone") {
if (windowProxy) {
windowProxy.close();
let url = "<!--MIRROR_URL-->/#/";
let url = "<!--MIRROR_URL-->" + window.location.pathname + "#/";
if (!url.includes("://")) {
url = window.location.protocol + "//" + url;
}

View file

@ -126,6 +126,7 @@ async function serveOfflinePage() {
};
}
});
if (title) {
text = text.replaceAll(/<!--OFFLINE_TITLE_START-->(.*?)<!--OFFLINE_TITLE_END-->/g, title);
}