title: How do I intercept an API call and display data from it using a UserScript?
body: <p>There's a webapp that makes a request (let's call it <code>/api/item</code>). This request returns a json body with a field called <code>itemData</code> which is normally hidden from the user, but I want to make that shown.</p>
  
  <p>So how do I make a userscript that listens for the request at <code>/api/item</code> and displays the itemData field?</p>
  
  <p>For reference the way the webapp is making the request is:</p>
  
  <pre><code>return Promise.resolve(new Request(e,r)).then(sendCookies).then(addLangParam).then(addCacheParam).then(addXsrfKey).then(checkZeroRating).then(function(e) {
              return fetch(e)
          }).then(checkStatus).then(checkApiVersionMismatch).then(checkApiResponse)
  </code></pre>
  
  <p>Most of that is irrelevant, but the important part is <code>Request</code> (I think).</p>