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.

[Bug] My software stucks on browser.close with plugin-stealth 2.7.x version

See original GitHub issue

My software stucks on browser.close with last version (puppeteer-extra-plugin-stealth)

I’m using more than 1 browser open at the same time, and when I’m trying to close 1 my software stucks. this has never happened with version 2.6.7 or before

my code:

var pages = await this.browser.pages()
for (let i = 0; i < pages.length; i++) {
    await pages[i].close();
}
await this.browser.close();

Tested with 2.7.x version

if i downgrade to 2.6.7 everything works fine

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:56 (23 by maintainers)

github_iconTop GitHub Comments

4reactions
berstendcommented, Sep 17, 2021

This should be fixed now through #530 (thanks @dev-hyperweb 👍 )

Successfully published:
 - puppeteer-extra-plugin-stealth@2.7.9
 - puppeteer-extra-plugin-user-data-dir@2.2.13
 - puppeteer-extra-plugin-user-preferences@2.2.13

cc @LinkTree3 @Dam998

4reactions
dalespitericommented, May 25, 2021

This happens for me as well with the default run settings listed in the documentation. browser.close locks up my terminal process. If I remove the puppeteer-extra requirement, and just go with the the vanilla puppeteer, everything is fine. There’s definitely a core issue with this package.

Literally just running the quickstart settings doesn’t work:

// puppeteer-extra is a drop-in replacement for puppeteer,
// it augments the installed puppeteer with plugin functionality.
// Any number of plugins can be added through `puppeteer.use()`
const puppeteer = require('puppeteer-extra')

// Add stealth plugin and use defaults (all tricks to hide puppeteer usage)
const StealthPlugin = require('puppeteer-extra-plugin-stealth')
puppeteer.use(StealthPlugin())

// Add adblocker plugin to block all ads and trackers (saves bandwidth)
const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker')
puppeteer.use(AdblockerPlugin({ blockTrackers: true }))

// That's it, the rest is puppeteer usage as normal 😊
puppeteer.launch({ headless: true }).then(async browser => {
  const page = await browser.newPage()
  await page.setViewport({ width: 800, height: 600 })

  console.log(`Testing adblocker plugin..`)
  await page.goto('https://www.vanityfair.com')
  await page.waitForTimeout(1000)
  await page.screenshot({ path: 'adblocker.png', fullPage: true })

  console.log(`Testing the stealth plugin..`)
  await page.goto('https://bot.sannysoft.com')
  await page.waitForTimeout(5000)
  await page.screenshot({ path: 'stealth.png', fullPage: true })

  console.log(`All done, check the screenshots. ✨`)
  await browser.close()
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Chrome update problems & failed updates - Google Support
Reboot your computer​​ The update might not have completed on your computer. Try rebooting your computer and updating Chrome again.
Read more >
PySimpleGUI
The Python 2.7 version is PySimpleGUI27 . ... If the user clicked the X button to close the window, then the button value...
Read more >
MacPorts Guide
MacPorts is an easy to use system for compiling, installing, and managing open source software. MacPorts may be conceptually divided into two main...
Read more >
What's New Change Log - FL Studio
Plugin added from Add > Channel goes to Mixer instead of Channel Rack; Polyphony bug with realtime stretching; Problem moving FL Studio window...
Read more >
Release Notes for Cisco DNA Center, Release 2.1.2.x
Added the open bug CSCvy30606. Open Bugs. 2021-07-14. Updated the following packages for 2.1.2.7: Cloud ...
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