MM-58777 Confirm that sendBeacon exists before trying to use it (#27458)

Этот коммит содержится в:
Harrison Healey
2024-06-26 01:13:53 -04:00
коммит произвёл GitHub
родитель 6fd894953c
Коммит 1505c37977

Просмотреть файл

@@ -308,6 +308,11 @@ export default class PerformanceReporter {
}
protected sendBeacon(url: string | URL, data?: BodyInit | null | undefined): boolean {
// Confirm that sendBeacon exists because it doesn't on Firefox with certain settings enabled
if (!navigator.sendBeacon) {
return false;
}
return navigator.sendBeacon(url, data);
}
}