This happened to me while using LinkedIn. I was in the middle of replying to a conversation what causes the page to register for beforeunload. But before sending my message I clicked on a download link of a PDF file sent by the other part. I was presented with the usual stay/leave dialog:
- Pressing "stay" cancels the download.
- Pressing "leave" will let the download go through.
Both situations are surprising from the user PoV and are not a good experience. The obvious fix would be to go on with the navigation until we know if it is actually a navigation and only then present the dialog. But I understand this would go against the standard for beforeunload handling.
I am also aware there's talks about moving away from beforeunload. Anyway I wanted to get this registered here to be at least one more data point to justify that move.
Comment 1 by cbentzel@chromium.org
, Jun 20 2016