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", "name": "keanuapp-weblite",
"version": "0.1.93", "version": "0.1.94",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View file

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

View file

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

View file

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