How to detect browser or tab closing in JavaScript - StackHowTo

How to detect browser or tab closing in JavaScript - StackHowTo