Is there a way to fake a synchronous XHR request?
问题 I'm porting a pile of C++ code to Javascript using the Emscripten system. The C++ code has many calls to fopen which is a synchronous IO call. Within Emscripten, we simulate this using an XHR request to a local resource however , within Firefox synchronous XHR calls (with a responseType of blob or arraybuffer ) are only supported within a Web-Worker. Converting all that c++ code to adapt to asynchronous IO code seems very complicated so for my first try, I'd like to see if I can fake a