Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Puppeteer v16 won't connect to browser servers created by Playwright #8747

Closed
andyMrtnzP opened this issue Aug 5, 2022 · 3 comments · Fixed by #8748 or #8743
Closed

[Bug]: Puppeteer v16 won't connect to browser servers created by Playwright #8747

andyMrtnzP opened this issue Aug 5, 2022 · 3 comments · Fixed by #8748 or #8743
Assignees

Comments

@andyMrtnzP
Copy link

Bug description

Steps to reproduce the problem:

  1. Launch a Chromium server with Playwright (tested on 1.23.4 and 1.24.2)
const { chromium } = require("playwright");
const getPort = require("get-port");

(async () => {
  const port = await getPort();

  chromium.launchServer({
    args: [
      `--remote-debugging-port=${port}`,
    ],
  });
  console.log(`Get wsEndpoint at ${`http://127.0.0.1:${port}/json/version`}`);
})();
  1. Get the webSocketDebuggerUrl from the /json/version endpoint
  2. Connect Puppeteer to the endpoint
// pptr.js
const puppeteer = require('puppeteer-core');

(async () => {
  const browser = await puppeteer.connect({
    browserWSEndpoint: "ws://127.0.0.1:53866/devtools/browser/d7975090-196a-47a1-b5fe-bd2f723bef5e"
  });
  const page = await browser.newPage();
  await page.goto("https://example.com/");
  console.log(await page.title());

  await browser.close();
})().catch(console.error);

Using Puppeteer v15.5.0 it executes as expected

>  node .\pptr.js
Example Domain

Using Puppeteer v16.0.0, it doesn't finish the connection, nor throws an exception

Puppeteer version

v16.0.0

Node.js version

v16.14, v16.15.1

npm version

v8.5.5, v8.12.2

What operating system are you seeing the problem on?

Linux, Windows

Relevant log output

No response

@andyMrtnzP andyMrtnzP added the bug label Aug 5, 2022
@OrKoN OrKoN added the confirmed label Aug 5, 2022
@OrKoN OrKoN self-assigned this Aug 5, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Aug 5, 2022

I am able to reproduce and I have a fix in mind but I am also curious about the use case: what's the use case behind connecting to the browsers started by Playwright using Puppeteer? P.S. thanks for reporting this issue!

@joelgriffith
Copy link
Contributor

@OrKoN use case is having puppeteer start/provision chrome and use it's APIs to allow other clients to connect and do what they need. The primary failure is with playwright atm, but we also support any CDP-based libraries so I can see potential impacts there as well.

@OrKoN
Copy link
Collaborator

OrKoN commented Aug 6, 2022

@joelgriffith thanks for the details! I think it's a bug on Puppeteer's side so it should not affect other CDP-based clients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants