title: Chrome extension: webRequest.onBeforeSendHeaders behaves strange
body: <p>I am trying to add a "Referer"-HTTP-Header to certain AJAX requests in my Chrome extension.
  You can't change it directly in the AJAX request so I tried to change it using the <a href="http://code.google.com/chrome/extensions/webRequest.html" rel="noreferrer" title="webRequest api (reference)">webRequest api</a>:</p>
  
  <pre><code>chrome.webRequest.onBeforeSendHeaders.addListener(function(data) {
      console.log("onBeforeSendHeaders fired");
      var xdata=data.requestHeaders;
      xdata.push({
          "name":"Referer",
          "value": "http://the.new/referrer"
      })
      return {requestHeaders: xdata};
  }, { //Filter
      urls: ["&lt;all_urls&gt;"], //For testing purposes
      types: ["xmlhttprequest"]
  },["requestHeaders","blocking"]);
  </code></pre>
  
  <p>But this doesn't work for the AJAX requests in my extension. It only fires the event on other AJAX requests but not the ones done in my extension.<br>
  Another strange thing is that everything works fine when "blocking" flag is not set, but then I can't change the headers.</p>
  
  <p>Does anyone know a way to solve this (or another way to achieve my goal: changing the "Referer" for a site request and retrieving the contents)</p>
  
  <p>Thank you :)</p>