hardkoded / puppeteer-sharp

Headless Chrome .NET API
https://www.puppeteersharp.com
MIT License
3.23k stars 431 forks source link

External browser stops responding after connecting too soon after launch #2632

Open PhantomGamers opened 1 month ago

PhantomGamers commented 1 month ago

Description

I've been stuck on PuppeteerSharp 6.2.0 for a while because the chromium instance I needed to interact with was stuck on a pre-100 version for the longest time and only recently got updated to 109.

After updating to the latest version of Puppeteer Sharp (v17), I noticed that if I connect to the browser instance as soon as it launches, just connecting and nothing else, the browser becomes unresponsive. I've narrowed down the issue to something added in PuppeteerSharp v9, v8 and everything below work fine.

Now I suspect this is some edge case with the particular application I'm trying to connect to, which in this case is the Steam client ran with the -cef-enable-debugging argument.

Complete minimal example reproducing the issue

Just running Puppeteer.ConnectAsync as soon as the debugging server starts seems to cause the issue.

I can provide a full minimal example later if I can't figure out the issue myself, just wanted to get this issue started here for documentation purposes.

Expected behavior:

Puppeteer connects to the browser, and the browser continues to operate normally.

Actual behavior:

Puppeteer connects to the browser, and the browser stops responding to user input.

Versions

Additional Information

The project in question that I'm working on that demonstrates this issue can be found here: https://github.com/PhantomGamers/SFP/tree/6cf9682cee684b79d945f8e4cc9c0bd0db59d0e9

It does do more than just connect, but I commented everything puppeteer related out except the connection and still was able to reproduce the issue.

I suspect the issue is related to this Introduce Target Managers commit but I need to look into it further at some point, hopefully during the week.