New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 620292 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

beforeunload dialog complicates the downloading of a file

Project Member Reported by carlosk@chromium.org, Jun 15 2016

Issue description

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.
 
Components: UI>Browser>Downloads
Should this be retitled to "Consider triggering beforeunload after it's known that a navigation will happen?"

Arguably we could do something like this in the case where the navigation is treated as idempotent, but if not the beforeunload handler would likely need to be issued at the current time.

Do you know what happens if an <a download> is clicked when a beforeunload handler is also present?

Comment 2 by dah...@chromium.org, May 11 2017

Owner: xingliu@chromium.org
Status: Assigned (was: Untriaged)
xingliu@, can you take a look at this and answer cbenzel's question and see what other browsers do in this case?
Components: Blink>PageLifecycle

Sign in to add a comment