title: Puppeteer How to check if the page has redirected
body: <p>I am trying to check with <code>waitForNavigation()</code> to see if the page switches or not. 
  Here is the code I am using</p>
  
  <pre><code>        if(await page.waitForNavigation() == null ){
              console.log('False')
              await browser.close()
          }else {
              console.log('True')
              await browser.close()    
          }
  </code></pre>
  
  <p>For example let us just say a box on the screen is there and you get redirected to another page. I want True or False to pop up on the console.log.</p>
  
  <p>I had to switch up the answer a bit but here it is</p>
  
  <pre><code>        if(newUrl == startingURL){
              console.log('False');
              await browser.close() 
          }else{
              console.log('True')
              await browser.close() 
          }
  </code></pre>