Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Browser Tab Close Event Handling

Hi folks,

Currently, I am having trouble reacting to users that close the browser tab my app is running in.

I tried the onExit()-Method of my app.controller.js but it seems the exit-event doesn't even get fired when all of a sudden I close the current browser tab.

I can imagine that there are solutions to my question but I did not find anything both on Google and SCN.

Looking forward to your help!

Regards

Dominik

Tags:
Former Member
Former Member replied

Hi Dominik

We cannot differentiate close tab and refresh.

Here is an example. I hope that it is useful to you. You can switch tab and do anything. But when you close the tab, you will be prompted

JS Bin - Collaborative JavaScript Debugging

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question