0

I know about window.onbeforeunload, but that also executes when the user clicks on a link or refreshes the page, while I want my function to only execute when the browser or tab is closed. Is there a way to do that?

blacktrance
  • 765
  • 2
  • 11
  • 25

1 Answers1

0

AFAIK the only options are unload and onbeforeunload so I would say the answer to your questions is "no".

https://developer.mozilla.org/en-US/docs/Web/Events/unload

Morpheus
  • 1,576
  • 1
  • 17
  • 29