mirror of https://github.com/xwiki-labs/cryptpad
remove tracking URLs from document location
This commit is contained in:
parent
586e0367fe
commit
7cc55f530f
|
@ -2610,6 +2610,16 @@ define([
|
|||
}).nThen(function () {
|
||||
// Load the new pad when the hash has changed
|
||||
var oldHref = document.location.href;
|
||||
|
||||
// remove tracking parameters from URLs
|
||||
try {
|
||||
var u = new URL(oldHref);
|
||||
u.search = '';
|
||||
if (u.href !== oldHref) {
|
||||
window.history.replaceState({}, window.document.title, u.href);
|
||||
}
|
||||
} catch (err) { console.error(err); }
|
||||
|
||||
window.onhashchange = function (ev) {
|
||||
if (ev && ev.reset) { oldHref = document.location.href; return; }
|
||||
var newHref = document.location.href;
|
||||
|
|
Loading…
Reference in New Issue