2

I'm testing a Chrome extensions and in order to setup everything correctly I would like to know the tabId when a new tab is created

 const browser = await puppeteer.launch({ ... });

 const appPage = await browser.newPage();
 await appPage.goto(appUrl, { waitUntil: 'load' });

 // TAB ID??????

I checked the documentation of the Page object but there is nothing about a tabId. So my question is, is it possible to extract a tabId with Puppereer?

Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
  • What's a tab id exactly and why do you need it? What functionality/behavior are you trying to implement that the page's object reference isn't good enough as an id, or assigning your own isn't sufficient? – ggorlen May 04 '22 at 00:11
  • 1
    Each tab has an id, which is used by the chrome extension for sending messages to the correct tab – Jeanluca Scaljeri May 04 '22 at 09:29

0 Answers0