In my website I have a page which sends some XHR requests to the same server, the problem is if the user click on any link to navigate to any other pages on the same server, the browser blocks and waits until all XHR finish first, then navigate, which can take ~10 seconds.
I already implemented the XHR abort solution, it's working but the browser still waiting for XHR responses. In my opinion xhr.abort() is only to prevent calling xhr.onload() only, but in reality the browser still waiting for the response from XHR.
How can I force the browser to close and destroy an XHR request immediately using JavaScript?
Code is a copy-paste of this one.
All this is happens in the same server. If I navigate to another server the browser navigate immediately, while if the link is in the same server the browser wait first to finish all XHR requests.