question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

page.click in background tabs are not working.

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.8.0
  • Platform / OS version: macOS Mojave / 10.14
  • URLs (if applicable):
  • Node.js version: v10.5.0

What is the expected result?

What happens instead?

when I create multiple pages and click on the same element in each page, clicking only works in the current tab. my code looks like below, any ways to acheive this?

let promises = []

for (page of pageLength) {
  promises.push(browser.newPage().then(crawlPage => {
    await crawlPage.goto('example.com')
    await crawlPage.click('#something')
    await crawlPage.waitForNavigation({ waitUntil: 'networkidle0'})
  })
}

await Promise.all(promises)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
aslushnikovcommented, Oct 4, 2018

Right, you should use page.bringToFront() in non-headless mode for now;

2reactions
antonioilievcommented, Nov 11, 2019

I have stumbled upon this thread as I encountered the same problem. From what I gather, this behaviour has not changed. Is there a plan to change it in the future?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Background tabs and pages not loading until focused on
As the title says every background tab AND page stops loading when they aren't focused on. I have browser games open in the...
Read more >
Google Chrome background tabs don't load/build until selected
It looks there's not enough of memory. Chrome loads the page (disk clings), then the OS unloads that memory to paging file. When...
Read more >
Chrome Extension not running everytime page action button is ...
I am creating an extension that I need to have the ability to run the content script multiple times when clicking on the...
Read more >
How to Stop Automatic Tabs Opening in Google Chrome
Scan for Malware · In Chrome, click three vertical dots and go to the Settings tab. · Scroll right to the bottom of...
Read more >
Tab Features | Vivaldi Browser Help
Hibernate a single tab (can't be the active tab);; A Tab Stack, or; Background Tabs. To hibernate Tabs in the Window Panel, right-click...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found