log locations

This commit is contained in:
Orion Reed 2023-08-12 22:52:01 +01:00
parent bb6af73dcc
commit 7df0ec5469
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@
var pathSegmentsToKeep = 1; var pathSegmentsToKeep = 1;
var l = window.location; var l = window.location;
console.log('location:', l);
l.replace( l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') + l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' + l.pathname.split('/').slice(0, 1 + pathSegmentsToKeep).join('/') + '/?/' +

View File

@ -28,6 +28,7 @@
var decoded = l.search.slice(1).split('&').map(function(s) { var decoded = l.search.slice(1).split('&').map(function(s) {
return s.replace(/~and~/g, '&') return s.replace(/~and~/g, '&')
}).join('?'); }).join('?');
console.log('decoded', decoded);
window.history.replaceState(null, null, window.history.replaceState(null, null,
l.pathname.slice(0, -1) + decoded + l.hash l.pathname.slice(0, -1) + decoded + l.hash
); );