SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
333 stars 105 forks source link

Unable to access Dialog in pupetter stream #160

Closed nbalasubramanianwaymore closed 1 month ago

nbalasubramanianwaymore commented 1 month ago

Can you let me know or provide me a way to access dialogs in pupetter stream as we do in pupetter Do we have anything like this page.on('dialog', async dialog => { //get alert message console.log(dialog.message()); //accept alert await dialog.accept(); })

Can someone help me on this

SamuelScheit commented 1 month ago

Yes puppeteer stream just returns a puppeteer browser instance that you can use to access dialogs.

https://pptr.dev/api/puppeteer.dialog

import { launch } from 'puppeteer-stream';

(async () => {
  const browser = await launch({});
  const page = await browser.newPage();
  page.on('dialog', async dialog => {
    console.log(dialog.message());
    await dialog.dismiss();
    await browser.close();
  });
  page.evaluate(() => alert('1'));
})();
nbalasubramanianwaymore commented 1 month ago

In my case , we get a dialog in the teams opening right? "Do you want to join the meet in browser or app?" I'm unable to access this alert with the above code.

I have attached the popup image which I need to access.

Can you let me know on this? teams_popup

SamuelScheit commented 1 month ago

Sorry, but I I don't have the time to fix your specific MS teams bug, which is not part of the library. Consider sponsoring or hiring me so I can help you.