title: Close Chrome window after oAuth exchange
body: <p>I have code that opens a window </p>
  
  <pre><code>let mywindow = window.open("utl", "title", "resizable=yes,width=600,height=400,toolbar=no,titlebar=no,menubar=no,scrollbars=yes");
  </code></pre>
  
  <p>I want to access the current URL of the window, I have tried:</p>
  
  <ul>
  <li>window.location</li>
  <li>window.document.url</li>
  </ul>
  
  <p>Every try returns:</p>
  
  <blockquote>
    <p>Uncaught DOMException: Blocked a frame with origin "<a href="https://mail.google.com" rel="nofollow noreferrer">https://mail.google.com</a>" from accessing a cross-origin frame.
        at eval (eval at  (chrome-extension://dapaeellgmlagjcopljjcfiadalafdil/extension.js:57053:21), &lt;anonymous>:1:10)
        at chrome-extension://dapaeellgmlagjcopljjcfiadalafdil/extension.js:57053:21</p>
  </blockquote>
  
  <p>I am doing an oAuth token exchange, when the window hits the redirect URI, I need the window to be closed automatically.</p>
  
  <p>What are the ways in which I can achieve this?</p>