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

use new headless chrome #8

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## [Unreleased](https://github.com/rubycdp/ferrum/compare/v0.12...main) ##
## [Unreleased](https://github.com/rubycdp/ferrum/compare/v0.13...main) ##

### Added

### Changed

### Fixed

### Removed

## [0.13](https://github.com/rubycdp/ferrum/compare/v0.12...v0.13) - (Nov 12, 2022) ##

### Added

Expand Down
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