title: Using Devtools protocol event Page.frameNavigated to get client side navigation redirects
body: <p>The <code>framenavigated</code> event in the Devtools protocol doesn't seem to be working the same way as the <code>framenavigated</code> event in Puppeteer. If I use the <code>parentframe</code> method in the Puppeteer example below I only get the client side navigation redirects which is what I want. If I use the Devtools protocol example replacing the <code>parentframe</code> method with <code>parentId</code> I don't get anything because the code doesn't get past <code>parentId</code>.</p>
  
  <p>How can I use the <code>framenavigated</code> event in the Devtools protocol to behave the same way as Puppeteer <code>framenavigated</code> and only get the navigation redirect chain?</p>
  
  <pre><code>// var url = "http://wechat.com";
  var url = "http://yahoo.com";
  
  const puppeteer = require('puppeteer');
  
  puppeteer.launch().then(async browser =&gt; {
  const page = await browser.newPage();
  
  // Puppeteer framenavigated example:
  page.on('framenavigated', frame =&gt; {
   if(frame.parentFrame() === null) {
  console.log("Puppeteer nav frame: ");
  console.log(frame._url);
  }
  });
  // Result returns:
  // Puppeteer nav frame:
  // https://uk.yahoo.com/?p=us
  
  // Devtools protocol framenavigated example:
  const client = await page.target().createCDPSession();
  await client.send('Page.enable');
  
  await client.on('Page.frameNavigated', (e) =&gt; {
  // console.log("Framenavigated event fired");
  if(e.frame.parentId === null) {
      console.log("Devtools protocol frame: ");
      console.log(e.frame.url);
   }
  });
  // Result returns: 
  // Either hangs up and times out or finishes but returns nothing
  
  await page.goto(url);
  await browser.close();
  
  });
  </code></pre>