title: Error: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience
body: <p>I am developing a <strong>chrome extension</strong> in which on button click I need data from <strong>ajax GET</strong> and after that need to go for further processing. For that, I want synchronous ajax call, but it is giving me an error </p>
  
  <blockquote>
    <p>Error: Synchronous XMLHttpRequest on the main thread is deprecated
    because of its detrimental effects on the end user's experience.</p>
  </blockquote>
  
  <p>I know this error is because I set <strong>async=false</strong>, but unless and until I don't get data from API, I cannot go for further processing. Below is my code:</p>
  
  <pre><code>var nonce;
  window.addEventListener('load', function load(event){
      var createButton = document.getElementById('send');
      createButton.addEventListener('click', function() { 
         signTransaction('abc',12,'abc');
      });
  });
  function signTransaction(to,amount,inputhex){
      nonce = getNonce();
      console.log(nonce);
      tx = {
          To : to,
          PrivateKey : pri,
          Balance : amount,
          Nonce : String(nonce),
          Gas : "1",
          Type : "a64",
          Input : inputhex
      }  
      let transaction = new sdag.Signs.NewTransaction(pri,tx);
  }
  function getNonce() {
      var request = new XMLHttpRequest();
      request.open('GET', 'http://192.168.xx.xx:9999/getAccount?address=xxxxxxxxx', false);
      request.onload = function () {
        var data = JSON.parse(this.response);
        if (request.status &gt;= 200 &amp;&amp; request.status &lt; 400) {
          nonce = data.Nonce;
        } else {
          console.log('error');
        }
      }
      // Send request
      request.send(null);
      return nonce;
     }
  </code></pre>
  
  <p>You can check in code, In <code>signTransaction()</code> first I need nonce from <code>getNonce()</code> function and then can go further. So, I set async false to this function. 
  Can somebody help me with this?</p>