ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

window unload event issue

more options

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.

Modified by Preetam Jakhmola

All Replies (1)

more options

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