only set event.retrunValue on `beforeunload` event