Ah, nm, I understand this now. The `beforeunload` handler is expected to return a value, which tells the browser whether to confirm with the user or not the window reload. So it must fire synchronously.