This commit is contained in:
Mike Cao 2020-08-22 19:55:53 -07:00
commit fa20f7f67f
9 changed files with 67 additions and 24 deletions

View file

@ -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;
}
};