vital987 / chrome-novnc

Chromium via noVNC (Browser in Browser)
MIT License
96 stars 58 forks source link

Playwright Support #16

Open cry0genic opened 1 month ago

cry0genic commented 1 month ago

Hey @vital987, thanks for helping with the Selenium Grid Support.

I now want to experiment running this with Playwright.

I tried changing the 5-chromium.conf with:

command=bash -c 'chromium --remote-debugging-port=9225 --no-sandbox --test-type --disable-dev-shm-usage --disable-gpu --start-maximized'

And for Playwright:

async with async_playwright() as p:
                browser = await p.chromium.connect_over_cdp("http://<container-ip>:9225")

However, this configuration is not working and I'm unable to debug the exact problem.

If you can help me with this in anyway, would really appreciate it.

Thanks!

cry0genic commented 1 month ago

Hey @vital987, following up, do let me know if you can help me out here.

Thanks!

cry0genic commented 1 month ago

Hey @vital987, just to give more context:

Things I've tried:

  1. Bound in docker-compose.yml ("9225:9225") + exposed it in Dockerfile (EXPOSE 9225)
  2. Chromium.conf: chromium --remote-debugging-address=0.0.0.0 --remote-debugging-port=9225
  3. Checking the stderr_logfile and it says DevTools listening on ws://127.0.0.1:9225/devtools/browser/<some-id>. Once I try connecting via either p.chromium.connect_over_cdp("ws://<container-ip>:9225/devtools/browser/<some-id>") or p.chromium.connect_over_cdp("http://<container-ip>:9225) - I get ECONNRESET or Timeout