Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Commit

Permalink
Try new headless Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
singhprd committed Apr 12, 2023
1 parent 9f5f884 commit 09e780c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ferrum/browser/options/chrome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Browser
class Options
class Chrome < Base
DEFAULT_OPTIONS = {
"headless" => nil,
"headless" => "new",
"disable-gpu" => nil,
"hide-scrollbars" => nil,
"mute-audio" => nil,
Expand Down
8 changes: 8 additions & 0 deletions lib/ferrum/browser/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ def start
end

env = Hash(@xvfb&.to_env).merge(@env)

puts "Starting Chromium"
puts "---"
puts env, *@command.to_a, process_options
puts "---"

@pid = ::Process.spawn(env, *@command.to_a, process_options)
puts "Chromium started with PID: #{pid}"

ObjectSpace.define_finalizer(self, self.class.process_killer(@pid))

parse_ws_url(read_io, @process_timeout)
Expand Down

0 comments on commit 09e780c

Please sign in to comment.