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?
Asked
Active
Viewed 104 times
0

Brian Tompsett - 汤莱恩
- 5,753
- 72
- 57
- 129

blacktrance
- 905
- 2
- 11
- 25
1 Answers
0
AFAIK the only options are unload
and onbeforeunload
so I would say the answer to your questions is "no".

Morpheus
- 1,616
- 1
- 21
- 31