title: Code behaviour changes when replacing internal .JSON with AJAX request
body: <p>I've replaced my internal .JSON with an AJAX request and now my code stopped working properly. My goal is it to write a chrome extension that closes a tab if its link contains certain keywords saved in the .JSON file. This is what the code looked before:<br></p>
  
  <pre><code>chrome.webNavigation.onCompleted.addListener(closeTab, {
    url: [
      {urlPrefix: 'https://www.google.de/'},
      {urlPrefix: 'https://sghm.eu/iserv/login'},
    ]
  });
  
  function closeTab(e) {
    if (!e.frameId) {
      chrome.tabs.remove(e.tabId);
    }
  }
  </code></pre>
  
  <p>This code worked for me.<br>
  Now the new one:<br></p>
  
  <pre><code>var obj = {};
      var xhttp = new XMLHttpRequest();
      xhttp.onreadystatechange = function(){
      if(xhttp.readyState == 4 &amp;&amp; xhttp.status == 200){
          obj = JSON.parse(xhttp.response);
          console.log(obj);
      }};
      xhttp.open('GET', "banned.json", true);
      xhttp.send();
  
  
      chrome.webNavigation.onCompleted.addListener(closeTab, obj);
  
      function closeTab(e) {
        if (!e.frameId) {
          console.log("Hallo2");
          chrome.tabs.remove(e.tabId);
        }
      }
  </code></pre>
  
  <p>And the banned.json file:<br></p>
  
  <pre><code>[
      "www.google.de",
      "www.youtube.com/?gl=DE"
  ]
  </code></pre>
  
  <p>This code now closes every tab disreagarding the link or antything else. But I don't know why. The AJAX works as the console successfully displays the JSON array, which was previously loaded.</p>