BeforeUnloadEvent is not available on older browsers
Merge pull request #405 from arv/before-unload-old-browser-work-around

BeforeUnloadEvent is not available on older browsers