title: Chrome extension: how can I intercept a cookie?
body: <p>I need to grab the event when the page loads, when the cookies are sent and change them.</p>
  
  <p>onBeforeRequest ---> my code ---> set cookie ---> set request</p>
  
  <p>I found this event - chrome.webRequest.onBeforeRequest.</p>
  
  <p>In all the articles and the documentation says that I need to ask for cookies in the details.requestHeaders:</p>
  
  <pre><code>chrome.webRequest.onBeforeRequest.addListener(
  function (details) {
     console.log(details.requestHeaders)
  },
  { urls: ["&lt;all_urls&gt;"] },
  ["blocking"]);
  </code></pre>
  
  <p>But it is always undefined.</p>
  
  <p>How to solve my problem?</p>