File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed
common/changes/@snowplow/browser-tracker-core
libraries/browser-tracker-core/src Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "changes" : [
3+ {
4+ "packageName" : " @snowplow/browser-tracker-core" ,
5+ "comment" : " Consistently access navigator via window.navigator" ,
6+ "type" : " none"
7+ }
8+ ],
9+ "packageName" : " @snowplow/browser-tracker-core"
10+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export function getBrowserProperties() {
1010 devicePixelRatio : window . devicePixelRatio ,
1111 cookiesEnabled : window . navigator . cookieEnabled ,
1212 online : window . navigator . onLine ,
13- browserLanguage : navigator . language || ( navigator as any ) . userLanguage ,
13+ browserLanguage : window . navigator . language || ( window . navigator as any ) . userLanguage ,
1414 documentLanguage : document . documentElement . lang ,
1515 webdriver : window . navigator . webdriver ,
1616 deviceMemory : ( window . navigator as any ) . deviceMemory ,
Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ export function Tracker(
228228 // First-party cookie secure attribute
229229 configCookieSecure = trackerConfiguration . cookieSecure ?? true ,
230230 // Do Not Track browser feature
231- dnt = navigator . doNotTrack || navigator . msDoNotTrack || window . doNotTrack ,
231+ dnt = window . navigator . doNotTrack || window . navigator . msDoNotTrack || window . doNotTrack ,
232232 // Do Not Track
233233 configDoNotTrack =
234234 typeof trackerConfiguration . respectDoNotTrack !== 'undefined'
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export function OutQueueManager(
8181 isBeaconAvailable = Boolean (
8282 isBeaconRequested &&
8383 window . navigator &&
84- window . navigator . sendBeacon &&
84+ typeof window . navigator . sendBeacon === 'function' &&
8585 ! hasWebKitBeaconBug ( window . navigator . userAgent )
8686 ) ,
8787 useBeacon = isBeaconAvailable && isBeaconRequested ,
@@ -412,7 +412,7 @@ export function OutQueueManager(
412412 type : 'application/json' ,
413413 } ) ;
414414 try {
415- beaconStatus = navigator . sendBeacon ( url , blob ) ;
415+ beaconStatus = window . navigator . sendBeacon ( url , blob ) ;
416416 } catch ( error ) {
417417 beaconStatus = false ;
418418 }
You can’t perform that action at this time.
0 commit comments