God bless Firefox v129

This commit is contained in:
Ahmed Al-Taiar
2024-08-22 00:05:14 -04:00
parent 593567a197
commit bb4b5708e1

View File

@ -95,11 +95,15 @@ const PortraitForm = (props: PortraitFormProps) => {
deleteFile(fileIdRef.current)
if (navigator.userAgent.match(/firefox|fxios/i)) {
// Dear Mozilla, please implement keepalive on Firefox
// Sincerely, everybody
const time = Date.now()
while (Date.now() - time < 500) {
/* empty */
const firefoxVer = Number(navigator.userAgent.match(/Firefox\/(\d+)/)[1])
// One day dom.fetchKeepalive.enabled becomes true by default... until then!
if (firefoxVer < 129) {
const time = Date.now()
while (Date.now() - time < 500) {
/* empty */
}
}
}
}