rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.69k stars 120 forks source link

Support for headless=new #379

Closed route closed 10 months ago

route commented 1 year ago

Addresses #352

ghost commented 10 months ago

Anything we can do to help get this implemented @route?

route commented 10 months ago

@lifesaverluke not that I can think of, I'm on it but I was sick and on the road.

route commented 10 months ago

It looks like even though I can be able to land support with frames, there's at least one quite major regression for Chrome which shows duplicated requests and there's an event missing which is quite crucial for network. So it's not gonna happen until they fix it.

ghost commented 10 months ago

A thing that changed for sure is that last_exchange is now the request to favicon.ico instead of the document. The old headless mode never loaded favicons, so that change makes sense.

Maybe we just need to adjust the tests?

route commented 10 months ago

A thing that changed for sure is that last_exchange is now the request to favicon.ico instead of the document. The old headless mode never loaded favicons, so that change makes sense.

Maybe we just need to adjust the tests?

No it’s not that simple, networking is broken

ghost commented 10 months ago

Bit weird that puppeteer / playwright etc do work with headless=new? What's the difference?

route commented 10 months ago

@lifesaverluke in general it works, but there are a lot of tests broken for networking. The design is different, the architecture is also different. But looks like I found solution to make it work disable-site-isolation-trials

In general the issue is with frames only https://www.chromium.org/developers/design-documents/oop-iframes/

route commented 10 months ago

Since "new" mode has a bug with file download behavior it's not default now, but you can turn on "new" mode if it satisfies your needs.

sandstrom commented 10 months ago

@route Awesome! πŸ˜„

Will there be a new release later, with this included?

route commented 10 months ago

released

janko commented 9 months ago

@route I appreciate the addition! Could we also get a new release of Cuprite? πŸ™πŸ» The current version locks Ferrum to 0.13.x, so I cannot upgrade to 0.14.x.

route commented 9 months ago

@janko yep I was going to do that, but need to do some stuff offline ;) life is life)

janko commented 9 months ago

@route Of course, as a fellow open source maintainer, I totally understand πŸ˜‰ I really appreciate all the work you did on Ferrum/Cuprite, it brought us tremendous benefits in my current company πŸ™ŒπŸ»

I decided we needed the new headless mode when I encountered a system test that was failing in old headless mode and passing in headful mode. We were able to use the new headless mode with current Cuprite by passing browser_options: { "headless" => "new" } to the driver, so not a blocker at all.

route commented 9 months ago

@janko Very good article btw!