Yeah, that's the idea. See the 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 global JavaScript environment is a document environment. User agents are strongly encouraged to warn of such usage in developer tools and may experiment with throwing an InvalidAccessError exception when it occurs.
What the browser is doing is following this recommendation above to warn you that this is a feature that should not be used. Or 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 by then. Terrible things, much worse than this, that were allowed 20 years ago still work today's browsers.
Unfortunately there are no more alerts. The vast majority of developers use things they should not do to the hills and do not even know it. Not only in JS in browsers, this holds true for many different languages and functionalities.
If something is considered obsolete, it should no longer be used in new things and whenever it has the opportunity to change something existing, it should be done.
Of course, if you do not you will not have problems for a long time, but there goes from the posture of each professional and resources (time mainly, to modify the existing one, although it is something fast in this case) that each one has.
But if you think about doing the synchronous request, it does not make much sense. If it's to do this, call the page. Many people find that AJAX is a programming language. It's just a very specific technique using XMLHTTPRequest
and A
means asynchronous (Asynchronous Javascript And XML). But no one else uses XML anymore:)