microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.
https://playwright.dev/dotnet/
MIT License
2.47k stars 235 forks source link

See if we can implement pipes now #190

Closed kblok closed 4 years ago

kblok commented 4 years ago

We weren't able to do that in the past. Let's see if we find a way now

Meir017 commented 4 years ago

I wonder if this would be possible using something in System.IO.Pipes AnonymousPipeServerStream? or something else

kblok commented 4 years ago

@Meir017 Chromium uses file descriptors 3 and 4 for pipes. In the C# world, it would be something like an extra set of StandardInput, StandardOutput, which is something that .NET didn't support in 2018, see https://github.com/dotnet/runtime/issues/26559.

mscottford commented 3 years ago

@kblok: I stumbled across this, and I'm wondering what the answer was. Did you figure out a way to implement this? Thanks!

kblok commented 3 years ago

Hey @mscottford, This is now supported through the Playwright driver.

seclerp commented 6 months ago

Hi @kblok, could you please explain in more detail how and where it was implemented? I have zero knowledge about Playwright implementation but I'm also struggling with proper handling --remote-debugging-port switch from client side.

I'm also interested in the Windows named pipes approach. AFAIK the issue you're referring to is about Unix descriptors, isn't it?

kblok commented 6 months ago

Hey @seclerp! This issue was created before playwright-dotnet started using playwright as a driver. playwright-dotnet knows opens a node process and talks to `playwright using stdin/stdout.

If you want to read about the limitations I found in .NET, this is the issue I created on dotnet/runtime.

seclerp commented 6 months ago

I see, thanks! I ended up with the similar idea of making a wrapper over Chromium process in Rust. Do you maybe had a chance to work with large CDP payloads going through stdin/stdout? Let's say 1Mb+. Does it work out of the box?

kblok commented 6 months ago

I see, thanks! I ended up with the similar idea of making a wrapper over Chromium process in Rust. Do you maybe had a chance to work with large CDP payloads going through stdin/stdout? Let's say 1Mb+. Does it work out of the box?

I didn't find issues on the "transport" side. I did get reports about the browser crashing with some massive setContent calls.