Issue metadata
Sign in to add a comment
|
Synchronous XMLHttpRequest in beforeunload handler fails
Reported by
freddy.e...@gmail.com,
Nov 15 2017
|
||||||||||||||||||||||
Issue descriptionUserAgent: 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:
,
Nov 16 2017
"@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."
,
Nov 17 2017
,
Nov 17 2017
+reillyg, who changed how sync XHRs worked awhile back
,
Nov 17 2017
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.
,
Nov 22 2017
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 |
|||||||||||||||||||||||
Comment 1 by manoranj...@chromium.org
, Nov 15 2017