mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Merge branch 'master' of https://github.com/mikecao/umami
This commit is contained in:
commit
fa20f7f67f
9 changed files with 67 additions and 24 deletions
25
lib/web.js
25
lib/web.js
|
|
@ -46,3 +46,28 @@ export const hook = (_this, method, callback) => {
|
|||
return orig.apply(_this, args);
|
||||
};
|
||||
};
|
||||
|
||||
export const doNotTrack = () => {
|
||||
if (
|
||||
window.doNotTrack ||
|
||||
navigator.doNotTrack ||
|
||||
navigator.msDoNotTrack ||
|
||||
'msTrackingProtectionEnabled' in window.external
|
||||
) {
|
||||
if (
|
||||
window.doNotTrack == '1' ||
|
||||
navigator.doNotTrack == 'yes' ||
|
||||
navigator.doNotTrack == '1' ||
|
||||
navigator.msDoNotTrack == '1' ||
|
||||
(window.external &&
|
||||
window.external.msTrackingProtectionEnabled &&
|
||||
window.external.msTrackingProtectionEnabled())
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue