Skip to content

Commit

Permalink
fix: change to strict equality operator for browserDoNotTrack status (#…
Browse files Browse the repository at this point in the history
…187)

* fix: change to strict equality operator for browserDoNotTrack status

* fix: missed update

Co-authored-by: skodamarthi <susmitha_kodamarthi@intuit.com>
  • Loading branch information
skodamarthi and skodamarthi authored Dec 4, 2022
1 parent c74b800 commit 6548ec2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/js/common/browserInfoHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,13 @@ export const getWindowHeight = () => validateAndGetScreenDetail(window.innerHeig
export const getBrowserDoNotTrackStatus = () => {
const windowVar = window,
navigatorVar = navigator;
/* eslint-disable eqeqeq */
const isBrowserDoNotTrack =
(windowVar.doNotTrack && windowVar.doNotTrack == '1') ||
(navigatorVar.doNotTrack && (navigatorVar.doNotTrack == 'yes' || navigatorVar.doNotTrack == '1')) ||
(navigatorVar.msDoNotTrack && navigatorVar.msDoNotTrack == '1') ||
(windowVar.doNotTrack && windowVar.doNotTrack === '1') ||
(navigatorVar.doNotTrack && (navigatorVar.doNotTrack === 'yes' || navigatorVar.doNotTrack === '1')) ||
(navigatorVar.msDoNotTrack && navigatorVar.msDoNotTrack === '1') ||
(windowVar.external &&
windowVar.external.msTrackingProtectionEnabled &&
windowVar.external.msTrackingProtectionEnabled());
/* eslint-enable eqeqeq */
return isBrowserDoNotTrack ? 'true' : 'false';
};

Expand Down

0 comments on commit 6548ec2

Please sign in to comment.