To be safe, call whatever the current handler is for `onbeforeunload` in your event handler