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

Issue 785266 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Synchronous XMLHttpRequest in beforeunload handler fails

Reported by freddy.e...@gmail.com, Nov 15 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. Create an event handler and bind it to the "beforeunload" event
2. Issue a synchronous XMLHttpRequest in this event handler
3. Close the window to trigger event

What is the expected behavior?
That the synchronous XMLHttpRequest is being performed before the window closes. Interestingly it works correctly if the developer tools are open.

What went wrong?
NetworkError: Failed to execute 'send' on 'XMLHttpRequest'

Did this work before? Yes Not sure. I think two or three versions before

Does this work in other browsers? Yes

Chrome version: 62.0.3202.94  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
 
Labels: Needs-Bisect Needs-Triage-M62
Cc: vamshi.k...@techmahindra.com
Labels: Triaged-ET Needs-Feedback
"@Reporter - Thanks for filing the issue.
Could you please provide a sample file to check the issue from TE-end.
This will help us in triaging the issue further."

Comment 3 by a...@chromium.org, Nov 17 2017

Components: Blink>Network>XHR

Comment 4 by dcheng@chromium.org, Nov 17 2017

Cc: kinuko@chromium.org dcheng@chromium.org
Owner: reillyg@chromium.org
+reillyg, who changed how sync XHRs worked awhile back

Comment 5 by creis@chromium.org, Nov 17 2017

Cc: panicker@chromium.org ojan@chromium.org
Components: Blink>PageLifecycle
Given the fact that it works when DevTools is open, I think this is likely due to the 1 second timeout for waiting for the beforeunload response from the renderer (which gets disabled by DevTools).

I'm inclined to think this is working as intended.  We don't want a slow server to prevent a user from closing a tab or navigating away.

Comment 6 by panicker@google.com, Nov 22 2017

Status: WontFix (was: Unconfirmed)
Yes, I don't think there is a fix required here.
Sync XHR is on the path to deprecation. we plan to explicitly disallow sync XHR, in beforeunload (and unload).

Sign in to add a comment