how to focus current tab puppeteer

Viewed 1149

How do I focus on the newly opened tab in puppeteer? I click an element on the page that opens up a new tab and then puppeteer stays focused on the page that was just left for some reason. How can I focus on the newly opened tab? I'm using google chrome browser

1 Answers

You can use the bringToFront function.

await page.bringToFront();
Related