title: Firefox WebExtensions: can not get canceled request data
body: <p>During playing with Firefox WebExtensions I've created a simple add-on that cancels certain POST request and reads its params:</p>
  
  <p><strong>manifest.json</strong></p>
  
  <pre><code>{
    "description": "Canceled webRequests data",
    "manifest_version": 2,
    "name": "webRequest-demo",
    "version": "1.0",
  
    "permissions": [
      "webRequest",
      "webRequestBlocking",
      "http://kamil.hism.ru/pocs/*"
    ],
  
    "background": {
      "scripts": ["background.js"]
    }
  }
  </code></pre>
  
  <p><strong>background.js</strong></p>
  
  <pre><code>var pattern = "http://kamil.hism.ru/pocs/simple_form_action";
  
  function cancel(requestDetails) {
    console.log("Canceling: " + requestDetails.url);
    console.log(requestDetails.requestBody.formData.some_field)
    // debugger
    return { cancel: true };
  }
  
  browser.webRequest.onBeforeRequest.addListener(
    cancel,
    { urls:[pattern] },
    ["requestBody", "blocking"]
  );
  </code></pre>
  
  <p>The target page with form is located here: <code>http://kamil.hism.ru/pocs/simple_form.html</code></p>
  
  <p><code>requestDetails</code> contains <code>requestBody</code> that should contain <code>formData</code> object with all passed data. In Chrome it works good, but in Firefox <code>requestBody</code> contains only <code>raw</code> array with an ArrayBuffer object. I've tried to convert it to string using <code>String.fromCharCode.apply(null, new Uint16Array(requestDetails.requestBody.raw[0]));</code>, but it returns empty string.</p>
  
  <p>So, the question is: does anybody know how to solve that problem and get all data from canceled request using Firefox WebExtension add-on? Maybe it's some bug in Mozilla's implementation of WebExtensions?</p>