From 9f5f8849b1a58960ae0c027d69cdb67ea289ec3d Mon Sep 17 00:00:00 2001 From: Dmitry Vorotilin Date: Sat, 12 Nov 2022 13:54:27 +0500 Subject: [PATCH 1/2] docs: Update CHANGELOG.md --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a0382cc..e17df1fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From 09e780cfb710e91ff104912c06a68f9767758a77 Mon Sep 17 00:00:00 2001 From: Peter Singh Date: Wed, 12 Apr 2023 10:07:54 +0100 Subject: [PATCH 2/2] Try new headless Chrome https://developer.chrome.com/articles/new-headless/ --- lib/ferrum/browser/options/chrome.rb | 2 +- lib/ferrum/browser/process.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ferrum/browser/options/chrome.rb b/lib/ferrum/browser/options/chrome.rb index 1cce92df..d4745307 100644 --- a/lib/ferrum/browser/options/chrome.rb +++ b/lib/ferrum/browser/options/chrome.rb @@ -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, diff --git a/lib/ferrum/browser/process.rb b/lib/ferrum/browser/process.rb index 9bf1ce8c..afad8b37 100644 --- a/lib/ferrum/browser/process.rb +++ b/lib/ferrum/browser/process.rb @@ -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)