Harden URL hash handling for UX mode
This commit is contained in:
+2
-1
@@ -1069,7 +1069,8 @@ function writeHash(){
|
|||||||
const p=new URLSearchParams();
|
const p=new URLSearchParams();
|
||||||
KEYS.forEach(k=>{ if (S[k]!==DEFAULT[k]) p.set(k,S[k]); });
|
KEYS.forEach(k=>{ if (S[k]!==DEFAULT[k]) p.set(k,S[k]); });
|
||||||
hashLock=true;
|
hashLock=true;
|
||||||
history.replaceState(null,"", p.toString()? "#"+p.toString() : location.pathname);
|
const baseUrl = window.location.pathname + window.location.search;
|
||||||
|
history.replaceState(null,"", p.toString()? "#"+p.toString() : baseUrl);
|
||||||
setTimeout(()=>hashLock=false,0);
|
setTimeout(()=>hashLock=false,0);
|
||||||
}
|
}
|
||||||
function readHash(){
|
function readHash(){
|
||||||
|
|||||||
Reference in New Issue
Block a user