puppeteer-extra
puppeteer-extra copied to clipboard
[Bug] TypeError: Cannot read properties of null (reading '1')
Describe the bug
Getting error on this line while using playwright-extra sometime
https://github.com/berstend/puppeteer-extra/blob/523b2efe7dc000536ef6bd608810d4e01e206504/packages/puppeteer-extra-plugin-stealth/evasions/user-agent-override/index.js#L82
Code Snippet
import { chromium } from "playwright-extra";
import StealthPlugin from "puppeteer-extra-plugin-stealth";
chromium.use(StealthPlugin());
const bs = await chromium.launchServer({
headless: headless,
executablePath: this.CHROMIUM_PATH,
args: [
"--no-sandbox",
"--disable-setuid-sandbox",
`--user-agent=${this.ua.userAgent}`,
`--ignore-certificate-errors`,
],
});
Versions
To provide more details, this is happening when the browser is launched via playwright
, and I try to connect with puppeteer.
I am using puppeteer and playwright side-by-side on my code and needs to connect to same browser to open a page for any of them.
if (browser == "playwright") {
return await chromium.connect({
wsEndpoint,
});
} else {
return await puppeteer.connect({
browserWSEndpoint: wsEndpoint,
ignoreHTTPSErrors: true,
});
}