rubycdp / ferrum

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

Use `--headless=new` Chrome flag #352

Closed singhprd closed 10 months ago

singhprd commented 1 year ago

Hello!

I have just read this: https://developer.chrome.com/articles/new-headless/

TLDR:

Chrome headless was released in 2017, and was technically a separate, alternate browser implementation that happened to be shipped as part of the same Chrome binary.

The Chrome team are unifying Headless and headful modes

To use the new mode start chrome with --headless=new

Currently, passing the --headless command-line flag without an explicit value still activates the old Headless mode — Chrome plan to change this default to new Headless over time.

I was wondering about starting a discussion here - should Ferrum default to setting --headless=new?

There might be more to do that just update the option here so it'd be great to hear thoughts?: https://github.com/rubycdp/ferrum/blob/main/lib/ferrum/browser/options/chrome.rb#L8

Proof of concept update from my fork here: https://github.com/fac/ferrum/pull/8/files

route commented 1 year ago

Yep, I was looking at this flag for a while, and I think it's good idea to turn it on by default instead of headless=true

JacobEvelyn commented 1 year ago

Any chance we can get this PR merged and released in a new version soon?

route commented 1 year ago

@JacobEvelyn I don't see any PR

JacobEvelyn commented 1 year ago

Oh sorry; I thought @singhprd's draft PR linked above was in this repo instead of a fork. @singhprd do you want to turn it into a PR here? @route @singhprd would it be helpful if I did?

route commented 1 year ago

@JacobEvelyn don't ask, do if you can ;) Apparently it's not that easy as turn on new mode, as there are a lot of failing tests.

route commented 1 year ago

As I can see it's not that easy as new Chrome works differently with frames, but I started to work on this.

jtoy commented 11 months ago

is it merged?

route commented 11 months ago

There’s nothing to merge yet

route commented 10 months ago

I'm closing this issue as there's a PR you can follow it.