MM-58777 Confirm that sendBeacon exists before trying to use it (#27458)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6fd894953c
Коммит
1505c37977
@@ -308,6 +308,11 @@ export default class PerformanceReporter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected sendBeacon(url: string | URL, data?: BodyInit | null | undefined): boolean {
|
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);
|
return navigator.sendBeacon(url, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user