JavaScript uses asynchronous calls in most of the modern APIs dealing with "slow" things like disk IO and network. I realize what the purpose of this, however there are certain cases when making synchronous calls really needed.
For example, I have a JavaScript code that I can't rewrite. In the code there are synchronous call to a certain method. For some debugging purposes at developer's environment I want to intercept this call, send information to server and wait until server responds. This interceptor won't work on production. AFAIK, there was a way to do this with NPAPI, but now it is officially deprecated. And both Google Chrome and Mozilla Firefox provide only asynchronous socket API, so I have no chance to perform such interception. Another way is to send syncrhonous XMLHttpRequest, but is is considerably slow, at is requires HTTP connection and HTTP payload, so I would prefer WebSocket.
I have another corner case where I have to call IndexedDB, but it is very hard to explain. Unfortunately IndexedDB sync API is not implemented anywhere.
Are there another hacks to call asynchronous methods synchronously? I would accept browser-specific hacks, browser add-ons, plugins and so forth. Or may be someone knows how to ask all those committees (and browser developers as well) that develop Web standards to include at least WebWorker versions of syncrhonous API?
I know, that questions about calling asynchronous method synchronously were asked many times, and the common answer is "this is a bad idea". I realize that generally it is a bad idea, but in a certain cases we really need freedom to call synchronously.