Skip to content

Commit

Permalink
Fixing issue with the setMaxListeners (#240)
Browse files Browse the repository at this point in the history
Co-authored-by: berstend <[email protected]>
  • Loading branch information
itsdarrylnorris and berstend committed Jul 6, 2020
1 parent ff8dfbc commit 40c47f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/puppeteer-extra-plugin-stealth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ class StealthPlugin extends PuppeteerExtraPlugin {
}

async onBrowser(browser) {
// Increase event emitter listeners to prevent MaxListenersExceededWarning
browser.setMaxListeners(30)
if (browser && browser.setMaxListeners) {
// Increase event emitter listeners to prevent MaxListenersExceededWarning
browser.setMaxListeners(30)
}
}
}

Expand Down

0 comments on commit 40c47f1

Please sign in to comment.