title: Catch URL after click with Cypress (window.location changes)
body: <p>I would like to know how to capture and read the URL after a click event on an <code>&lt;a&gt;</code> link.</p>
  <p>On the onClick event our javascript does some string manipulation of the  actual <code>href</code> of the clicked link and then a <code>window.location.href = myNewReplacebleURL</code> is done on the fly. The original <code>href</code> is not necessarily the location you get to after the onClick.</p>
  <p>Here is how I started:</p>
  <pre class="lang-js prettyprint-override"><code>describe(&quot;Twitter&quot;, function() {
  
    it(&quot;Should assert that via value is set correctly in JS&quot;, function() {
  
      cy.server();
      cy.visit(Cypress.config(&quot;appUrl&quot;) + &quot;/probes/sha/sha-via.html&quot;);
      cy.get(&quot;#v_test ul.share li a&quot;)
        .click();
  
    });
  
  });
  </code></pre>
  <p><strong>EDIT</strong>: What I would like is to catch the URL located at the &quot;Page Load&quot; step.</p>
  <p><a href="https://i.stack.imgur.com/KaiVg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KaiVg.png" alt="enter image description here" /></a></p>