Disable tracking if file is local
parent
9ee6fb994c
commit
c2e3ff7e5a
|
@ -7,7 +7,7 @@
|
||||||
document,
|
document,
|
||||||
history,
|
history,
|
||||||
} = window;
|
} = window;
|
||||||
const { hostname, pathname, search } = location;
|
const { hostname, pathname, search, protocol } = location;
|
||||||
const { currentScript } = document;
|
const { currentScript } = document;
|
||||||
|
|
||||||
if (!currentScript) return;
|
if (!currentScript) return;
|
||||||
|
@ -45,7 +45,8 @@
|
||||||
const trackingDisabled = () =>
|
const trackingDisabled = () =>
|
||||||
(localStorage && localStorage.getItem('umami.disabled')) ||
|
(localStorage && localStorage.getItem('umami.disabled')) ||
|
||||||
(dnt && doNotTrack()) ||
|
(dnt && doNotTrack()) ||
|
||||||
(domain && !domains.includes(hostname));
|
(domain && !domains.includes(hostname)) ||
|
||||||
|
(/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(hostname) || protocol === 'file:');
|
||||||
|
|
||||||
const _data = 'data-';
|
const _data = 'data-';
|
||||||
const _false = 'false';
|
const _false = 'false';
|
||||||
|
|
Loading…
Reference in New Issue