0

I developed a solution which detect when the page is being unload, using on beforeUnload JS function, the code works fine but I need to do some modifications based in the actions of the user, for instance if the user reload/refresh the page, I need to avoid The code execution inside the onBeforeUnload.

Is there a way to do that? I mean many other solutions propose to use onBeforeUnload which I’m using but I need to differentiate between the deifferents events that trigger the onBeforeUnload call.

Hien Nguyen
  • 24,551
  • 7
  • 52
  • 62
  • Take a look at this post https://stackoverflow.com/a/55087265/5066625 – Miroslav Glamuzina May 05 '19 at 03:43
  • Possible duplicate of [Check if page gets reloaded or refreshed in Javascript](https://stackoverflow.com/questions/5004978/check-if-page-gets-reloaded-or-refreshed-in-javascript) – Dat Boi May 05 '19 at 04:26
  • @MiroslavGlamuzina I tried that method but i need to get the action that the user just performed, with that method i'm getting a "Delay" for example if the user just refresh the page i'm getting "navigate" which is the action that the user performed before the reload, i need to get the action that the user just performed in that moment before the page is unloaded. – Edgardo Rodriguez May 05 '19 at 22:19

0 Answers0