diff --git a/macrovision.js b/macrovision.js index 94cbe3c1..1bb69032 100644 --- a/macrovision.js +++ b/macrovision.js @@ -3002,7 +3002,15 @@ document.addEventListener("DOMContentLoaded", () => { unitSelector.addEventListener("input", selectNewUnit); - param = new URL(window.location.href).searchParams.get("scene"); + param = window.location.hash; + + // we now use the fragment for links, but we should still support old stuff: + + if (param.length > 0) { + param = param.substring(1); + } else { + param = new URL(window.location.href).searchParams.get("scene"); + } document.querySelector("#world").addEventListener("mousedown", e => { // only middle mouse clicks @@ -4418,7 +4426,7 @@ function b64DecodeUnicode(str) { function linkScene() { loc = new URL(window.location); - const link = loc.protocol + "//" + loc.host + loc.pathname + "?scene=" + b64EncodeUnicode(JSON.stringify(exportScene())); + const link = loc.protocol + "//" + loc.host + loc.pathname + "#" + b64EncodeUnicode(JSON.stringify(exportScene())); window.history.replaceState(null, "Macrovision", link); try { navigator.clipboard.writeText(link);