I\'ve been using synchronous XMLHttpRequest with responseType set to \"arraybuffer\" for quite a while to load a binary file and wait until it is loaded. Today, I got this e
If you're lucky enough to have control over the entry point of the whole page, consider wrapping the whole thing with an async
function and using await
to block on problematic asynchronous code. Might not work with all use cases though.
(async function () {
await problem_function_1();
await problem_function_2();
... normal page logic pasted here ...
})();
Wrap async code that is not a promise with a Promise
(so that await works as expected), and call the resolve function manually in whatever constitutes a "success callback". Do the same for reject if possible.