How to show a confirm box on closing a tab or hiting back button on mobile browsers?

77 views Asked by At

I have a web app and I want to avoid that someone accidentally press the back button on the phone, losing all the javascript data that was produced. I tried the window.onbeforeunload aproach. It works at the desktop, but not in the phone.

Is there any way to do this?

0

There are 0 answers