Yeah, that’s the idea. Look at specification:
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.
What the browser is doing is following the above recommendation to warn that this is a resource that should not be used. Either use the asynchronous request or do this in a thread (worker).
Note that this will take so long that little done today will be alive there. Terrible things, far worse than this, that were allowed 20 years ago still work from today’s browsers.
Unfortunately, there are no more alerts. The vast majority of developers use things they shouldn’t use in bulk and don’t even know it. Not only in JS in browsers, this is true for many different languages and functionalities.
If something is considered obsolete, it should no longer be used in new things and whenever you have the opportunity to change something existing, it should be done.
Of course if you do not will not have problems for a long time, but there goes the posture of each professional and resources (time mainly to modify the existing, although it is something fast in this case) that each has.
But if you think about doing the synchronous request doesn’t make much sense. If you want to do this, call the page. Many people think that AJAX is a programming language. It’s just a very specific technique using XMLHTTPRequest
and the A
means asynchronous (Asynchronous Javascript And XML). Only no one uses XML anymore :)
Excellent question +1
– Jorge B.
For years use synchronous requests has been advised against, even before the process of deprecation, simply by the negative effect on the user experience. I have seen this being insistently said in the English OS at least since 2012. Still, a lot of people still insist on using it. Nice attitude from the Chrome team to show a warning. And good attitude on your part to ask about it :)
– bfavaretto