File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/tracking/src/events Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,12 @@ export const createTracker = ({ apiBaseUrl, verbose }: TrackerOptions) => {
2424 }
2525
2626 // Firefox allows users to disable navigator.sendBeacon, and very old Safari versions don't have it.
27- // [WEB-1700]: Additionally, Chrome 79-80 gives "Illegal invocation" with ?., so through 2022 we should support them.
28- // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
29- if ( navigator . sendBeacon && navigator . sendBeacon ( uri , form ) ) {
27+ const sendBeacon =
28+ // [WEB-1700]: Additionally, Chrome 79-80 gives "Illegal invocation" with ?., so through 2022 we should support them.
29+ // It seems similar to this: https://github.com/vercel/next.js/issues/23856
30+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
31+ navigator . sendBeacon && navigator . sendBeacon . bind ( navigator ) ;
32+ if ( sendBeacon ?.( uri , form ) ) {
3033 return ;
3134 }
3235
You can’t perform that action at this time.
0 commit comments