Merge pull request #44 from joshinat0r/master

fix DNT check
This commit is contained in:
Mike Cao 2020-08-22 09:15:56 -07:00 committed by GitHub
commit 59f68b8395
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 7 deletions

View File

@ -48,13 +48,24 @@ export const hook = (_this, method, callback) => {
};
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
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 && window.external.msTrackingProtectionEnabled())
) {
return true;
} else {
return false
return false;
}
} else {
return false
return false;
}
}
};

File diff suppressed because one or more lines are too long