mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
proper cross browser dnt support
This commit is contained in:
parent
4a3ce9acba
commit
aebf3c7022
2 changed files with 14 additions and 2 deletions
12
lib/web.js
12
lib/web.js
|
|
@ -46,3 +46,15 @@ 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.msTrackingProtectionEnabled()) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue