title: Detect URL change of SPA (single page app) inside iframe
body: <p>I have a React web app which render iframe. The iframe shows simple website or SPA websites.
  I want to invoke a function every time the URL changes in the iframe.
  Multiple solutions are using the &quot;onLoad&quot; , but this doesn't work for SPA application URL changes as I checked.
  Anyone have a solution to detect iframe URL change of SPA?</p>
  <p>Code example:</p>
  <pre class="lang-js prettyprint-override"><code>function App() {
  
    return (
      &lt;div &gt;
        &lt;iframe id='iframeid' onLoad={(e)=&gt;{console.log('page loaded', e)}} src=&quot;http://127.0.0.1:8001&quot; style={{position: 'absolute', height: '100%', border: 'none'}} width='100%'&gt;&lt;/iframe&gt;
      &lt;/div&gt;
  
    );
  }
  
  export default App;
  </code></pre>
  <p><a href="http://127.0.0.1:8001/" rel="nofollow noreferrer">http://127.0.0.1:8001/</a> is SPA which I run locally</p>
  <p>The onLoad work on the initial loading of the page, but when URL changes (using react-router) nothing happens.</p>