Mobile browser discovery Close Event

Is there a way to detect a mobile browser close event? I need to force cookies to be deleted in the browser. I already tried my luck with window.onbeforeunload and window.unload , but they do not work for mobile browsers. Searching the Internet a lot, but got no solution.

Thanks in advance

+5
source share
2 answers

Sorry, but this is simply not possible with Javascript ... You can prevent the action of closing a tab, but not doing something when it is close ...

How to define a browser window / tab Close event?

+3
source

Use $ (window) .blur (function () for mobile browsers.

+1
source

Source: https://habr.com/ru/post/1213116/


All Articles