According to xhr specs async: false
is deprecated and modern user agents should start to warn about or even to throw exception.
Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform as it has detrimental effects to the end user's experience. (This is a long process that takes many years.) Developers must not pass false for the async argument when the JavaScript global environment is a document environment. User agents are strongly encouraged to warn about such usage in developer tools and may experiment with throwing an InvalidAccessError exception when it occurs.
I understand and agree with argument about "detrimental" effects. The main point about this deprecation is you can solve any of your tasks with async XHR. However, I can see at least two applications of sync XHR in browser:
1) window.onbeforeunload. Any async xhr is useless here since browser tab will close immediately. Example of usage XHR in onbeforeunload event is document "lock". User opened document in new tab and document is locked by him now. Everyone can view this doc in read-only. Then user closes tab and document should unlock. I don't see any solution with async request, until user agent is guaranted that async request will be performed, and, even more, will not be aborted after tab close.
2) click event on anchor (<a>
tag). It's close to previous case because it's also closes current window in creates new one in the same tab. Let's say I just want to track click on critical links on page (but I beleive there are more noble examples of this event synchronous usage). The one workaround is to do e.preventDefault() in handler and then assign location manually, but this can break middle mouse button behavior (force open new tab).
The questions are: 1) Are user agents must complete async XHR even when tab is already closed? 2) Are there more smart solutions for my examples?