title: How to detect url change in a new browser tab and get back the url?
body: <p>I have a link that will open a url in a new tab like this: </p>
  
  <pre><code>&lt;a href="#" target="teamViewer" style="color: deepskyblue"&gt;&lt;span data-bind="text: connectorLoginLink, visible: shouldShowConnectorLoginLink, click: openTeamViewerUrl"&gt;&lt;/span&gt;&lt;/a&gt;
  </code></pre>
  
  <p>As I want to detect the URL change in the new tab, I thought I had to use window.open(url) to open this link. Then, keep track of the new window.</p>
  
  <p>In viewmodel: </p>
  
  <pre><code>public openTeamViewerUrl() {
      var newWindow = window.open('http://www.google.com', '_blank', 'location=yes');
  }
  </code></pre>
  
  <p>I want to set the opened tab to a newWindow object, then monitor it by using something like this: </p>
  
  <pre><code>var currentPage = newWindow.location.href;
  
      setInterval(function () {
          console.log(currentPage);
          if (currentPage !== newWindow.location.href) {
              // page has changed, set new page as 'current'
              currentPage = newWindow.location.href;
  
              console.log(currentPage);
              // do other thing...
          }
      }, 1000);
  </code></pre>
  
  <p>I got the error back when trying window.open: <strong>Blocked opening '<a href="http://www.google.com/" rel="nofollow noreferrer">http://www.google.com/</a>' in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.</strong></p>
  
  <p>Really got stuck on this. How to by pass the allow-popups? Can this feature be achieved using other methods?</p>