Question: how to handle the popup and access the popup to do some operations on it. 

```
const puppeteer = require('puppeteer');

async function run() {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('https://example.com');
    await page.click(Launchpopup);
}

```

Answer: 
So what I do is I login to facebook on their homepage, then navigate to the page I want to go to where the sign in with facebook button is I click on it. And then this code below will once the popup happens click on the login with facebook button.

```js
await page.click('[service_name="facebook"]')
const newPagePromise = new Promise(x => browser.once('targetcreated', target => x(target.page()))); 
const popup = await newPagePromise;
await popup.waitForSelector('[name="__CONFIRM__"]')
const confirm = await popup.$('[name="__CONFIRM__"]')
await popup.click('[name="__CONFIRM__"]')
await page.waitFor(2000);
await page.goto('your login page'); $

```
You should check out the documentation for v0.12.0-alpha, it describes how to interact with dialogs. 

```
const puppeteer = require('puppeteer');

puppeteer.launch().then(async browser => {
  const page = await browser.newPage();
  await page.goto('https://example.com');
  page.on('dialog', async dialog => {
    console.log(dialog.message());
    await dialog.dismiss();
    await browser.close();
  });
  page.evaluate(() => alert('1'));
});

```

Relevant [docs can be found here](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-dialog).