berstend / puppeteer-extra

💯 Teach puppeteer new tricks through plugins.
https://extra.community
MIT License
6.23k stars 732 forks source link

[Bug] navigator.webdriver beforeLaunch options.args is undefined #787

Closed xithalius closed 1 year ago

xithalius commented 1 year ago

Describe the bug

I'm getting the following error:

TypeError: Cannot read properties of undefined (reading 'findIndex')
at Plugin.beforeLaunch (../node_modules/puppeteer-extra-plugin-stealth/evasions/navigator.webdriver/index.js:36:30)
at PuppeteerExtra.callPluginsWithValue (../node_modules/puppeteer-extra/dist/index.cjs.js:392:48)
at async PuppeteerExtra.launch (../node_modules/puppeteer-extra/dist/index.cjs.js:120:19)

Code Snippet

import puppeteer from 'puppeteer-extra';
import StealthPlugin from 'puppeteer-extra-plugin-stealth';

puppeteer.use(StealthPlugin());

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

Versions

System: OS: macOS 13.2.1 CPU: (8) arm64 Apple M1 Pro Memory: 302.16 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v18.12.1/bin/yarn npm: 9.1.3 - ~/.nvm/versions/node/v18.12.1/bin/npm npmPackages: puppeteer: 19.8.0 => 19.8.0 puppeteer-core: 19.8.0 => 19.8.0 puppeteer-extra: 3.3.6 => 3.3.6 puppeteer-extra-plugin-adblocker: 2.13.6 => 2.13.6 puppeteer-extra-plugin-stealth: 2.11.2 => 2.11.2

Temporary solution

After commenting out the code of the beforeLaunch method everything is working as expected.