Adding feature to use url params to temp or permanently disable umami

pull/801/head
Pat 2021-09-28 05:34:48 -07:00
parent 21f0ad2b78
commit b91f6d206a
1 changed files with 5 additions and 1 deletions

View File

@ -28,10 +28,14 @@ import { removeTrailingSlash } from '../lib/url';
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(search) || [null, ''])[1].replace(/\+/g, '%20')) || null;
}
if (getURLParameter('setlsdnt')) {
localStorage.setItem('umami.disabled', 'true');
}
const disableTracking =
localStorage.getItem('umami.disabled') ||
(dnt && doNotTrack()) ||
getURLParameter("dnt") != null
getURLParameter('dnt') != null
(domains &&
!domains
.split(',')