title: Make fetch call really synchronous
body: <p>Yes, I want to do it completely synchronous. I know that it will completely stop my one and only thread, but I really need that, because I use some SDK which I don't want to change and in this SDK you need to pass a function that will be called and that will change some value in there like that:</p>
  
  <pre><code>function onNonce(stuff) {
      const url = 'fancy url to change stuff';
  
      // await also doesn't work
  
      // const response = await fetch(url);
      // const resp_json = await response.json();
      // return resp_json.token;
  
      // await also doesn't work
  
      const req = new XMLHttpRequest();
      req.open("GET", url, false); // &lt;-- completely sync and deprecated
      req.send();
  
      if(req.readyState === 4 &amp;&amp; req.status === 200) {
          return req.response.token;
      }
  }
  </code></pre>
  
  <p>And this is how my func is called:</p>
  
  <pre><code>function SDK(result) {
      //
      // SOME FANCY CODE
      //
  
      var the_value_to_change;
  
      the_value_to_change = onNonce('some stuff');
      console.log("async");
  
      //
      // SOME FANCY CODE that uses this the_value_to_change
      //
  }
  </code></pre>
  
  <p>If I use await then my func returns <strong>Promise</strong> instead of the token, and if I use <strong>open</strong> with <strong>true (async)</strong>, then I get <strong>undefined</strong>. The variant with <strong>false (completely sync)</strong> is deprecated, so I want to do the same stuff with fetch API.</p>
  
  <p>// EDIT //</p>
  
  <p>So, how can I do the execution of <strong>onNonce</strong> function (<strong>fetch</strong> and <strong>response.json()</strong>) completely synchronous?</p>