You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letunloaded=false// prevents double firing if both are supported
12
12
13
-
// using document instead of window because of bug affecting browsers before safari 14 (detail in footnotes https://caniuse.com/?search=visibilitychange)
14
-
document.addEventListener('pagehide',()=>{
13
+
window.addEventListener('pagehide',()=>{
15
14
if(unloaded)return
16
15
unloaded=true
17
16
cb()
18
17
})
19
18
19
+
// using document instead of window because of bug affecting browsers before safari 14 (detail in footnotes https://caniuse.com/?search=visibilitychange)
Copy file name to clipboardExpand all lines: packages/browser/src/lib/priority-queue/persisted.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ export class PersistedPriorityQueue extends PriorityQueue<Context> {
109
109
}
110
110
})
111
111
112
-
document.addEventListener('pagehide',()=>{
112
+
window.addEventListener('pagehide',()=>{
113
113
// we deliberately want to use the less powerful 'pagehide' API to only persist on events where the analytics instance gets destroyed, and not on tab away.
0 commit comments