Page 1 of 1

Trap Browser 'refresh' button

Posted: 04 Nov 2021, 19:45
by eduardorama
Is there a way to detect that the user clicked the browser's refresh button? not the 'F5' key or 'ctrl + R' just the browser's refresh button.
I know the button itself cannot be hidden but we want to add a logic when it is clicked.

Is that possible?

Thanks,
Eduardo

Re: Trap Browser 'refresh' button

Posted: 06 Nov 2021, 11:42
by Dino
most likely not a way to detect the actual press of the button in the browser interface, but you can detect that the user refreshed the page, by checking something you left in the cache and is not longer there or reset.

some other ideas here: https://stackoverflow.com/questions/500 ... javascript