title: How to click elements within pop-up/new tab windows in Puppeteer
body: <p>I have used the following example to target a pop-up window/newtab, but the methods available to me  after the fact are limited. I can only really do things like capture the URL and close the tab (among other things).</p>
  
  <p>What I am trying to do is interact with a google/twitter sign in pop-up, but puppeteer doesn't seem to have a solution for multiple window handles, at least when trying to interact as in click elements.</p>
  
  <pre><code>const newPagePromise = new Promise(x =&gt; browser.once('targetcreated', target =&gt; x(target.page()));
  await page.click('my-link'); //Opens pop-up window
  const newPage = await newPagePromise;
  </code></pre>
  
  <p>I'm looking to have something like this (in addition to the code written above):</p>
  
  <pre><code>const element = await newPage.$(selector);
  await element.click();
  </code></pre>
  
  <p>This does not work. Has anyone else had this need?</p>