puppeteer-extra icon indicating copy to clipboard operation
puppeteer-extra copied to clipboard

[Bug] TypeError: Cannot read properties of null (reading '1')

Open vickyRathee opened this issue 1 year ago • 1 comments

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

image

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

vickyRathee avatar Sep 19 '22 05:09 vickyRathee

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,
      });
    }

vickyRathee avatar Sep 19 '22 08:09 vickyRathee