X
Thinta lapha ukuze uye kuveshini yamakhalekhukhwini kusayithi.

Isithangami Sabeseki

window unload event issue

Kuphostiwe

I have made some async function call in window unload event, which works perfect for all browser but in Firefox it creates issue whenever the closing tab is last tab. It does not call the windows unload event. Technically each tab must work same. like works in chrome. Whenever we have multiple tabs it works well but however the last tab closes it does not work.

I have made some async function call in window unload event, which works perfect for all browser but in Firefox it creates issue whenever the closing tab is last tab. It does not call the windows unload event. Technically each tab must work same. like works in chrome. Whenever we have multiple tabs it works well but however the last tab closes it does not work.

Okulungisiwe ngu Preetam Jakhmola

Isicaphuno

Eminye Imininingwane Yohlelo

Isisebenziso

  • I-ejenti Engumsebenzisi: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Eminye Imininingwane

jscher2000
  • Top 10 Contributor
8569 izisombululo 70085 izimpendulo
Kuphostiwe

I think I remember this from another thread somewhere.

Can you use navigator.sendBeacon()? See:

I actually haven't tested whether that works on the last tab or not.


There is a bug on file related to the last tab. If I understand it correctly:

https://bugzilla.mozilla.org/show_bug.cgi?id=1532555

Before commenting, see: Bugzilla Etiquette

I think I remember this from another thread somewhere. Can you use navigator.sendBeacon()? See: * https://developer.mozilla.org/docs/Web/API/Navigator/sendBeacon * https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Synchronous_and_Asynchronous_Requests#Adapting_Sync_XHR_use_cases_to_the_Beacon_API I actually haven't tested whether that works on the last tab or not. ---- There is a bug on file related to the last tab. If I understand it correctly: * async XHR calls should never work in unload per spec * sync XHR calls in unload do not work in the last tab in Firefox * sync XHR calls in unload are expected to stop working in Chrome version 78 (https://www.chromestatus.com/feature/4664843055398912 ) https://bugzilla.mozilla.org/show_bug.cgi?id=1532555 Before commenting, see: [https://bugzilla.mozilla.org/page.cgi?id=etiquette.html Bugzilla Etiquette]
Ingabe lokhu kube usizo kuwena?
Isicaphuno
Buza umbuzo

Kufanele ulogele ukungena ku-akhawunti yakho ukuze uphendule amaphosti. Uyacelwauqale umbuzo omusha, uma ungekabi nayo i-akhawunti namanje.