How can I detect whether onunload
event is triggered by browser
close or tab
close?
I have onunload
event captured in the application and that works fine - to warn the user before leaving page. However, in case there are multiple tabs of the application open and if user selects to close the browser, user gets a prompt if he wants to close all tabs. Now, after hitting close all tabs, I do not want user to individually attend prompt(raised by onunload
event) on all the tabs. If close all tabs is clicked onunload
should be disabled.
So, can I capture that whether close all tabs is clicked in onunload
event?