Skip to content

Commit 961fdd4

Browse files
authored
Check type of navigator.sendBeacon (#2039)
1 parent b50f837 commit 961fdd4

File tree

1 file changed

+1
-1
lines changed
  • packages/opentelemetry-exporter-zipkin/src/platform/browser

1 file changed

+1
-1
lines changed

packages/opentelemetry-exporter-zipkin/src/platform/browser/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import * as zipkinTypes from '../../types';
2727
*/
2828
export function prepareSend(urlStr: string, headers?: Record<string, string>) {
2929
let xhrHeaders: Record<string, string>;
30-
const useBeacon = navigator.sendBeacon && !headers;
30+
const useBeacon = typeof navigator.sendBeacon === 'function' && !headers;
3131
if (headers) {
3232
xhrHeaders = {
3333
Accept: 'application/json',

0 commit comments

Comments
 (0)