Hi, i want to do show the "Are you sure you want to leave this page?" in iOS Safari.
How can I do that?
On desktop browsers, I use this snippet (ReactJS):
And the implementation:
Thanks!
How can I do that?
On desktop browsers, I use this snippet (ReactJS):
Code Block javascript window.addEventListener('beforeunload', onUnload)
And the implementation:
Code Block javascript useUnload((e) => { e.preventDefault() // Required for Firefox e.returnValue = '' delete e.returnValue })
Thanks!