title: Google chrome webrequest conflict?
body: <p>Can someone please explain to me why and if it is the desired behavior that the following code WILL NOT ALWAYS alert the same value twice in a row when visiting webpages assuming a small delay in clicking "ok" on the alert box?</p>
  
  <p>Usual simple extension set up with the following code in background.js:</p>
  
  <pre><code>chrome.webRequest.onBeforeRequest.addListener(function(request) {
      alert(request.requestId);
      alert(request.requestId);
      return {};
  }, {urls: ["*://*/*"]}, ["blocking"]);
  </code></pre>
  
  <p>I just cannot get this. I need the same value to pop up twice because I will be doing AJAX requests and I cannot permit myself to have variables changing behind my back with potential delays in AJAX...</p>
  
  <p>If it is the desired behaviour how can I make sure this does not happen? Would closures help?</p>
  
  <p>Thanks</p>