Merge pull request #35 from joshinat0r/master

Respect DNT
This commit is contained in:
Mike Cao 2020-08-21 08:53:35 -07:00 committed by GitHub
commit 30c84dd54a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View file

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