title: Get page url inside of an iframe rendered by a browser extension
body: <p>I have a browser extension rendering a react webpage in an iframe, and I want to be able to access the current page URL in the page rendered by the iframe.</p>
  <p>My current solution is to send a message requesting the URL from background.js, but right now I am not able to send a message or get a response.</p>
  <p>I would appreciate if you could help get the messenger working, or if you could let me know of a better way to get the current tab url.</p>
  <p>This is the background.js</p>
  <pre><code>chrome.runtime.onMessageExternal.addListener((request, sender, sendResponse) =&gt; {
    if (request) {
      if (request.message) {
        if (request.message === 'version') {
          sendResponse({ version: '1.1.1.0' })
        } else if (request.message === 'test') {
          // this is where the url would be gotten
          sendResponse(&quot;hello world&quot;)
        }
      }
    }
    return true
  })
  </code></pre>
  <p>This is the file that sends the message</p>
  <pre><code>chrome.runtime.sendMessage('&lt;&lt;The local dev id of the extension&gt;&gt;', {message: &quot;test&quot;}, 
    function(response) {
      console.log(response);
    }
  );
  </code></pre>
  <p>The listener doesn't log anything to the console when I've included any the file that sends the message receive any response.</p>