Prepend protocol to redirection link if needed

This commit is contained in:
N-Pex 2025-12-22 13:10:10 +01:00
parent f7032f659a
commit edc1824130

View file

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