Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot connect to Chrome using Playwrighter but can connect to Edge
#1
Is it just me or anyone else?

I can connect to Chrome before but now can only connect to Edge.
I think there is something wrong with my computer or Chrome version.

The error:
Quote:Microsoft.Playwright.PlaywrightException: connect ECONNREFUSED 127.0.0.1:9222
Call log:
  - <ws preparing> retrieving websocket url from http://127.0.0.1:9222
   at line 96 in Playwrighter.cs, Playwrighter.Connect(IPage& page, String url, PWConnectOptions options, Boolean debug)
   at line 16 in Test.cs, Program.Main(String[] args)
   >>
#2
Before starting Chrome with command line like --remote-debugging-port=9222, ensure that there are no chrome.exe processes (visible or hidden). Else Chrome ignores the command line. You can see processes and their command lines in Task Manager or System Informer.

To correctly start Chrome you can use class PlaywrightRunBrowser. It's in the same file as Playwrighter.
#3
Forgot to say that I cannot connect to an opening Chrome-Profile but if I use Playwrighter.Launch, it working normally. I can do it before, but now can only do it with Edge
#4
I discovered the reason. That is due to updates of Chrome:
Quote:Therefore, from Chrome 136 we're making changes to the behavior of --remote-debugging-port and --remote-debugging-pipe. These switches will no longer be respected if attempting to debug the default Chrome data directory.
#5
Thank you. I updated Playwrighter code: added info and PlaywrightRunBrowser parameter to use command line switch --user-data-dir which is now required for Connect.

https://www.libreautomate.com/forum/show...p?tid=7779


Forum Jump:


Users browsing this thread: 1 Guest(s)