Skip to content

Update dependency ferrum to '~> 0.22.0' - #282

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/ferrum-0.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/ferrum-0.x

Conversation

@renovate

@renovate renovate Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
ferrum (source, changelog) '~> 0.20.1' → '~> 0.22.0' age confidence

Release Notes

rubycdp/ferrum (ferrum)

v0.22.0

Compare Source

Added
  • network.clear_cache clears the browser's HTTP cache, network.clear_traffic the collected traffic [#​749]
  • :ssl_context for connecting to the browser at an https :url or a wss :ws_url with your own TLS settings [#​742]
  • new_window: for create_target and create_page of a context and of the browser opens a window instead of a tab
  • close_target of a context and of the browser closes a target and removes it from the context at once, so
    targets and pages stop listing it right away instead of when Chrome reports it destroyed, as after page.close
  • browser.on_page { |page| } calls the block with every new page, popups included, before Ferrum returns it, so the
    page can be set up before anything runs on it
  • The gem ships its RBS signatures from sig/, so type checkers pick them up without local stubs [#​731]
  • Network::Request#match?, #initial_priority and #referrer_policy, and Network::AuthRequest#url_fragment and
    #body, as all request classes now share RequestParams [#​743]
  • mouse.wheel(delta_x:, delta_y:) turns the mouse wheel at the pointer, firing a wheel event and scrolling the
    element under it, unlike scroll_by [#​744]
  • RemoteObject#evaluate, #evaluate_handle and #execute run JavaScript with this bound to the handle, as on
    Node [#​746]
  • Network::Response#from_disk_cache? and #from_service_worker? tell whether a response came from the disk cache or
    a service worker [#​751]
  • browser.disconnect closes the connection and leaves the browser running, so close, disconnect and
    process.stop make up a custom shutdown. quit still stops a browser disconnected this way [#​750]
  • browser.shutdown asks the browser to exit, lets a launched one do so before killing it, and also shuts down a
    remote browser, unlike quit. process.stop(grace:) waits that long before signaling [#​750]
  • context.downloads lists and awaits the downloads of every page in the context [#​753]
Changed
  • evaluate awaits a returned promise in the same CDP call, so an object result crosses the socket once instead of
    twice, and an awaited script takes one call
  • A command cut off by a navigation, such as a script awaiting a promise, raises
    Ferrum::ExecutionContextDestroyedError instead of Ferrum::NodeNotFoundError, or a plain Ferrum::BrowserError in
    an iframe, as no node is involved. It isn't retried
  • A Node or RemoteObject argument from a previous page or another isolated world raises
    Ferrum::ForeignObjectError instead of Ferrum::NodeNotFoundError
  • downloads.files and await_download return Ferrum::Download objects instead of event hashes, with path
    where Chrome saved the file, state, completed?, suggested_filename and to_h for the raw params [#​751]
  • window_bounds returns the shape window_bounds= takes, symbol keys and window_state:, instead of CDP's string
    keys and "windowState" [#​751]
  • A wss:// connection to the browser verifies its certificate and host name and sends SNI, as the https
    /json/version request already did. A self-signed browser needs :ssl_context, see the option [#​742]
  • User-Agent and Accept-Language set through headers are only sent with requests, they no longer change what
    navigator reports. Use network.emulate(user_agent:, accept_language:) to override both
  • Request interception takes one step: the first on(:request) or on(:auth) turns it on, network.intercept only
    narrows what's paused, and continues requests even before any callback is added. authorize takes an optional
    block [#​745]
  • A pattern given to intercept narrows authorize, blacklist= and whitelist= too, they no longer reset it to
    *. Auth challenges and listed URLs outside the pattern aren't handled, widen it and filter with match? [#​745]
  • An unknown mouse button, cookies.remove without :domain or :url, a relative go_to without :base_url and a
    relative :save_path raise ArgumentError instead of RuntimeError or Ferrum::Error. A failed screencast and
    debug_url raise Ferrum::Error. Errors that had no message or a misleading one say what's missing now [#​557]
  • set_behavior moved from page.downloads to context.downloads and browser.downloads, as Chrome sets it for the
    whole context. browser.downloads is the default context's, page.downloads lists only the page's downloads [#​753]
  • set_behavior takes :allow_and_name instead of :allowAndName, and needs save_path: only for :allow and
    :allow_and_name [#​753]
Deprecated
  • :extensions, browser.add_extension and browser.extensions, will be removed in 1.0. Use :init_scripts,
    browser.add_init_script and browser.init_scripts
  • network.clear, will be removed in 1.0. Use network.clear_traffic or network.clear_cache [#​749]
  • browser.reset, will be removed in 1.0. Use browser.contexts.reset [#​748]
Fixed
  • evaluate of a script that starts a navigation and returns an object raised NoExecutionContextError, it returns
    the object now
  • Objects and arrays returned by evaluate and execute are released in the page, they stayed alive until it
    navigated to another document
  • A JavaScript call or execution_id! on a frame, page or worker that went away, or on a browser that died, while it
    had no execution context raises NoExecutionContextError at once, it waited out the whole timeout
  • keyboard.type and node.type type \n in a string as Enter, it was dropped
  • A failed Browser.new interrupted while it cleans up, e.g. by Timeout.timeout, closes the socket, stops its
    threads and the browser process instead of leaking them [#​738]
  • A message from Chrome over :ws_max_receive_size raises DeadBrowserError that names the limit [#​739]
  • browser.quit and restart interrupted while closing the connection to a hung browser, e.g. by Timeout.timeout,
    still stop the browser process [#​740]
  • authorize without a block no longer warns NoMethodError on every request [#​745]
  • A page or worker closed outside Ferrum, e.g. by window.close(), drops its event callbacks instead of keeping them
    for the rest of the browser's life [#​750]
  • :process_timeout bounds the TLS handshake of a wss:// connection too, a host that accepts the connection and
    never answers raises ConnectTimeoutError instead of hanging [#​741]
  • Downloads are tracked without :save_path, and a page sees its own when another page set the behavior. A new or
    closed page no longer resets it, and a popup's download shows up on the page that opened it [#​753]
Removed
  • page.close_connection and worker.close_connection, a page's events stop once Chrome detaches it [#​750]
  • Network::AUTHORIZE_BLOCK_MISSING, authorize no longer needs a block [#​745]
  • Target#page=, a private API Cuprite no longer needs, build pages with create_page and set them up with
    on_page
  • Browser::Options::BASE_URL_SCHEMA, use BASE_URL_SCHEMES
  • target.window? and windows of a context and of the browser, use target.opener_id, await_page { ... } or
    pages(&:opener_id)
  • :js_errors, uncaught exceptions are in page.console with source: :exception, and page.on(:console) yields them
  • :pending_connection_errors and PendingConnectionsError, use go_to!, it raises NavigationTimeoutError
  • current_url and current_title of pages and frames, use url and title, or frame.page.url for the top window
    from a frame
  • cookies.all, use to_a, or map(&:name) for the names
  • flatten: false, every page shares the browser's websocket connection
  • FERRUM_DEBUG, use FERRUM_LOG=*
  • :protocol_timeout, browser.protocol_timeout, browser.protocol_timeout= and FERRUM_PROTOCOL_TIMEOUT, they were
    ignored, :timeout bounds everything else
  • wait: of click, mouse.up and mouse.down, use navigation_wait:. FERRUM_CLICK_WAIT and FERRUM_GOTO_WAIT,
    use FERRUM_NAVIGATION_WAIT
  • mode: and keys: of node.click, use button: :right or count: 2, and modifiers:
  • Positional mouse.scroll_by(x, y) and scroll_to(x, y), pass x: and y:
  • accessibility.enable and disable, use accessibility.enabled = true/false
  • goto, go, reload and reload!, use go_to, refresh and refresh!
  • frame.set_content, use content=
  • node.scroll_into_view, node.axnode and node[name], use scroll, ax_node and property(name)
  • contexts.each { |id, context| }, each yields the context, use context.id for the id
  • request_id of intercepted and auth requests, post_data of requests, and timestamp and monotonic_time of
    Network::Error, use id, body and time
  • disable_javascript, bypass_csp(enabled:), network.cache(disable:), offline_mode and
    emulate_network_conditions, use javascript = false, bypass_csp =, cache =, offline = true and throttle
  • body, use html. type and type? of Network::Request and type of Network::Response, use resource_type
    and resource_type?
  • Ferrum::NotImplementedError, nothing raises it since node.hover works
  • Passing a Hash with an "objectId" key to evaluate as a remote object, it is passed as a plain Hash now. Pass the
    Ferrum::RemoteObject from evaluate_handle
  • node.find_position, use pinpoint, its offsets are measured from the center unless position: :top
  • wait_for_navigation, wait_for_navigation!, wait_for_reload, wait_for_selector, network.wait_for_idle,
    wait_for_idle!, downloads.wait and node.wait_for_stop_moving, use await_navigation, wait_css, wait_xpath,
    wait_idle, page.await_download and wait_still. Positional network.idle?(n), pass connections:

v0.21.0

Compare Source

Added
  • page.javascript = true/false and javascript? turn the page's scripts on and off, there was no way back on
  • network.offline = true/false takes the page offline and back online, network.throttle(latency:, download:, upload:)
    slows it down. Each replaces the other's conditions, Chrome keeps one set of them
  • page.bypass_csp = true/false and network.cache = true/false
  • Ferrum::Deadline.within(seconds) { ... } bounds every call the block makes with one budget, page.go_to, cookies
    and evaluate included. go_to raises NavigationTimeoutError once it runs out
  • timeout: on go_to, refresh, back, forward, click and await_navigation bounds the whole call with a single
    Ferrum::Deadline
  • context.target(id) returns the context's target with that id
  • timeout: on keyboard.type, node.type and mouse.move bounds all the keys or steps together, the page timeout
    by default, raise it for a long text
  • context.await_page { ... }, and browser.await_page for the default context, runs the block and
    returns the page it opens, in a tab or a window, or nil if none opens in time. await_page! raises
    Ferrum::TimeoutError instead. Pass opener: to only get the pages opened by one page
  • pages of a context and of the browser takes a block that selects targets, e.g. pages(&:opener_id) for
    the pages opened by another page
  • go_to(url, referrer:) sets the referrer of that navigation only, the page's other requests don't carry it
  • cookies.set accepts http_only: and same_site: next to httponly: and samesite:, like the cookie's readers
  • cookies[name, domain:, path:] picks one of the cookies sharing a name
  • context.cookies with every cookie in the context whatever its domain, browser.cookies is the default context's
  • network.emulate(user_agent:, accept_language:, platform:, metadata:) overrides what the page reports in the request
    headers and in navigator, platform had no way to be set before, and metadata keeps the client hints Chrome
    otherwise stops sending once the user agent is overridden
  • go_to!, refresh!, back! and forward! raise NavigationTimeoutError, a TimeoutError naming the requests
    still pending, when the page doesn't load in time
  • browser.off, window_bounds, window_bounds=, tracing, activate and document_size reach the page like the
    rest of its methods
  • Waits share two verbs: await_* runs a block and waits for the event it triggers, wait_* polls a check.
    page.await_navigation { }, context.await_page { } and page.await_download { } return the navigation's result,
    the page or the download. wait_css, wait_xpath, network.wait_idle, node.wait_still and page.wait_until { }
    return what they waited for. Every one returns nil on timeout and has a ! version that raises TimeoutError
  • node.hover moves the mouse over the node, it raised NotImplementedError
  • node.pinpoint(x:, y:, position:) returns the point a click on the node lands on, x and y are an offset from
    the center or, with position: :top, from the top-left corner. A single offset applies, and so does the offset of a
    node without a box
Changed
  • Commands without a result return nil instead of true, self or Chrome's raw response: set_viewport, resize,
    stop, close, activate, execute, remove_script_on_new_document, dialog.accept/dismiss, network.intercept,
    clear and emulate, headers.add/set/clear, cookies.set/remove/clear/load, downloads.set_behavior,
    console.clear, browser.close/reset, context.dispose, contexts.dispose and worker.close. node.remove,
    select_file and execute return the node, like the other node commands
  • node.click(offset:) and hover(offset:) measure x and y from the center by default, pass position: :top for
    the top-left corner
  • browser.contexts.each and the Enumerable methods yield contexts instead of [id, context] pairs
  • refresh, back and forward return nil when the page doesn't load in time instead of raising, use refresh!,
    back! and forward! to raise
  • network.idle? takes connections: as a keyword
  • client.command needs a timeout: and has no async: true, use client.notify to send without waiting, and
    browser.command defaults to the browser's timeout
  • Internal commands have a fixed 5 second timeout and the connection is closed once a write to the browser stalls for
    30 seconds, :protocol_timeout no longer sets either
  • Creating pages and contexts follows timeout
  • wait: of click, mouse.up and mouse.down is renamed to navigation_wait:, false skips the wait
  • The waits after a click and after go_to share one default, Page::NAVIGATION_WAIT, set by FERRUM_NAVIGATION_WAIT
  • page.command doesn't take wait: anymore, wrap it in page.await_navigation to wait for a navigation it starts.
    Passing wait: or async: to a command raises ArgumentError, they would be sent to the browser as parameters
  • page.event is page.idle and holds a Ferrum::Concurrency::Cell, not a Concurrent::Event
  • browser.targets and context.targets return a copy of the hash, it doesn't follow the targets that come and go
  • go_to, refresh and the script methods no longer restart the timeout for each step, one timeout covers the whole call
  • click, mouse.move, keyboard.type, back, forward, wait_css and node scripts share one timeout across the
    commands they send, they restarted it for each
  • page.on(:request), on(:auth) and on(:dialog) callbacks form a chain: they run in order and the rest are skipped
    once one continues, responds to, aborts, accepts or dismisses, and an unhandled request is continued. They receive
    only the object, not index and total, use handled? to check whether a previous callback took it. A callback
    that holds a request to answer later gets it continued, and one registered after the handler no longer sees it
  • page.cookies is the cookies the page sees, the ones sent to its URL and its frames' URLs, or each(urls:). It
    returned every cookie in the context, use browser.cookies or browser.contexts[page.context_id].cookies for that.
    set and remove default to the page's host, clear keeps other domains, store/load are on the context only
  • NoSuchPageError is a NoSuchTargetError now, so rescuing NoSuchTargetError covers a target Chrome no longer
    knows, like a closed page, as well as one Ferrum doesn't track
  • Every script runs the new way: keyword arguments are named parameters, promises and thenables are awaited, all
    statements run and the last one's value is returned, and Node#evaluate returns nodes and dates, see
    upgrading [#​673]
  • on with a raw CDP event yields only the params, not the callback's index and the total number of callbacks
  • node.click takes button:, count: and modifiers: like mouse.click, and holds the keys of keyboard.hold when
    no modifiers: are given. The mouse methods take modifiers: as key names as well as a bitfield
  • mouse.scroll_by and scroll_to take x: and y:, an omitted one doesn't scroll along its axis
  • keyboard.modifiers and held_modifiers are internal now, pass modifiers: as key names
Deprecated
  • target.window?, will be removed in 0.22. Use target.opener_id, it is set for a target another one opened
  • windows of a context and of the browser, will be removed in 0.22. Use await_page { ... } for the page a click
    opens, or pages(&:opener_id) for all of them
  • cookies.all, will be removed in 0.22. Keyed by name, it kept one of the cookies sharing a name, use to_a, or
    map(&:name) for the names
  • wait_for_navigation and wait_for_navigation!, will be removed in 0.22. Use await_navigation(watch:)
  • wait_for_reload, will be removed in 0.22. Use await_navigation { ... } around the code that reloads the page
  • wait_for_selector, will be removed in 0.22. Use wait_css or wait_xpath
  • network.wait_for_idle and wait_for_idle!, will be removed in 0.22. Use wait_idle, duration: is interval:
  • downloads.wait, will be removed in 0.22. Use page.await_download { ... }
  • node.wait_for_stop_moving, will be removed in 0.22. Use wait_still
  • Passing connections to network.idle? positionally, will be removed in 0.22. Pass connections:
  • current_url and current_title on pages and frames, will be removed in 0.22. Use url and title, or
    frame.page.url for the top window from a frame, frame.url is the frame's own
  • :js_errors, will be removed in 0.22. Uncaught exceptions are in page.console with source: :exception, use it or
    page.on(:console) instead
  • :pending_connection_errors and PendingConnectionsError, will be removed in 0.22. Use go_to! instead
  • User-Agent and Accept-Language set through headers changing what navigator reports, will stop in 0.22, where
    they are only sent with requests. Use network.emulate(user_agent:, accept_language:) to override both
  • flatten: false, the option will be removed in 0.22 and every page will share the browser's websocket connection
  • FERRUM_DEBUG, will be removed in 0.22. Use FERRUM_LOG=* instead
  • :protocol_timeout, browser.protocol_timeout, browser.protocol_timeout= and FERRUM_PROTOCOL_TIMEOUT, will be
    removed in 0.22. They are ignored and warn, :timeout bounds everything else
  • wait: of click, mouse.up and mouse.down, will be removed in 0.22. Use navigation_wait: instead
  • FERRUM_CLICK_WAIT and FERRUM_GOTO_WAIT, will be removed in 0.22. Use FERRUM_NAVIGATION_WAIT instead
  • goto, go, reload and reload!, will be removed in 0.22. Use go_to, refresh and refresh!
  • frame.set_content, will be removed in 0.22. Use content=
  • node.scroll_into_view, will be removed in 0.22. Use node.scroll
  • node.axnode, will be removed in 0.22. Use node.ax_node
  • node[name], will be removed in 0.22. Use node.property(name)
  • contexts.each { |id, context| }, will be removed in 0.22. each yields the context
  • request_id of intercepted and auth requests, will be removed in 0.22. Use id, like Request#id
  • post_data of requests, will be removed in 0.22. Use body
  • disable_javascript, bypass_csp(enabled:), network.cache(disable:), offline_mode and
    emulate_network_conditions, will be removed in 0.22. Use javascript = false, bypass_csp =, cache =,
    offline = true and throttle
  • timestamp and monotonic_time of Network::Error, will be removed in 0.22. Use time, which is now set for every
    failure, not only the ones the browser logs a message for
  • mode: and keys: of node.click, will be removed in 0.22. Use button: :right or count: 2, and modifiers:
  • Positional mouse.scroll_by(x, y) and scroll_to(x, y), will be removed in 0.22. Pass x: and y:
  • accessibility.enable and disable, will be removed in 0.22. Use accessibility.enabled = true/false
  • body, will be removed in 0.22. Use html, it always returned the whole document
  • type and type? of Network::Request and type of Network::Response, will be removed in 0.22. Use
    resource_type and resource_type?, like the intercepted requests
  • Passing a Hash with an "objectId" key to evaluate as a remote object, will be removed in 0.22. Pass the
    Ferrum::RemoteObject from evaluate_handle
  • node.find_position, will be removed in 0.22. Use pinpoint, its offsets are measured from the center unless
    position: :top
Fixed
  • Network::Request#time keeps the fraction of a second, it was truncated to whole seconds
  • A Browser.new that failed or was interrupted while connecting left its connection and threads open, it closes them now
  • An unreachable url or ws_url host blocked Browser.new for the OS connect timeout, it raises
    Ferrum::ConnectTimeoutError, a TimeoutError, after process_timeout now
  • back on the first history entry reloaded the page, it returns nil now
  • A headful browser with xvfb: true sometimes started before Xvfb was ready and exited at once with
    ProcessTimeoutError, Ferrum waits for the display now
  • tracing.record timed out when page.on("Tracing.tracingComplete") was subscribed before its first call
  • page.command(method, wait:) ran a subclass override of command, like Cuprite's, twice
  • evaluate of a result nested about 100 levels deep raised an opaque BrowserError about Chrome's CBOR stack limit,
    it raises ResultTooDeepError now, a BrowserError that says to return less or use evaluate_handle
  • worker.close never closed a dedicated worker, Chrome refuses to close it from outside, it closes itself now
  • page.on(:request, &:continue) never continued the request, it called continue(index, total) and the error was
    dropped. Symbol procs and lambdas taking one argument get only the object now, for :request, :response, :auth
    and :dialog
  • AuthRequest#abort raised BrowserError and left the page hanging, it cancels the auth challenge now
  • InterceptedRequest#navigation_request? and AuthRequest#navigation_request? always returned nil, they are true
    for document requests now
  • evaluate raised NoMethodError when a node inside a Map or Set was also referenced elsewhere in the result
  • go_to kept sending a Referer after headers.clear or headers.set had removed it
  • headers.clear kept sending the old headers until the next add or set, and kept the user agent and language they
    set. Now it clears them in Chrome right away
  • headers.add and headers.set reset a user agent or language set with network.emulate, and made Chrome stop
    sending client hints, even for headers like X-Trace. They touch the user agent and language only when given one
  • pdf(path:) returned true while screenshot(path:) and mhtml(path:) return the number of bytes written, now it
    returns the byte count too
  • mouse.scroll_by and scroll_to animated on a page with scroll-behavior: smooth in a Chrome without
    --disable-smooth-scrolling, so the position was mid-scroll when they returned. They scroll instantly now
  • at_css, css, at_xpath and xpath on a node inside an iframe raised NodeNotFoundError, now they search the
    node's own frame
  • Node#moving? returned true for a node that wasn't moving and false for one that was. Its default delay is now
    50ms instead of 10ms, which missed a slowly moving node, set it with FERRUM_NODE_MOVING_CHECK
  • Node#click and #find_position on a CSS-transformed node whose content quads can't be computed aimed by its
    untransformed size and could miss it, now they aim at the center of its bounding rect. An SVG node raised
    JSON::GeneratorError there [#​695]
Removed
  • #evaluate_async, #evaluate_func and #evaluate_on, use #evaluate and Node#evaluate, and
    page.await_navigation!(watch:) { } for evaluate_on's wait: [#​673]
  • FERRUM_JS_API [#​673]
  • permanent: of headers.add, it only kept a Referer off the requests after the navigation, pass referrer: to
    go_to instead. headers.add("X-Trace" => "1") works without braces now, it raised ArgumentError
  • page.referrer and page.referrer=, pass referrer: to go_to instead
  • Mouse::CLICK_WAIT and Page::GOTO_WAIT, use Page::NAVIGATION_WAIT
  • Browser::Options::Base, Chrome is the only browser, Browser::Options::Chrome has everything it had
  • Ferrum::ServerError, nothing raised it
  • :browser_name, it only switched between Chrome-named defaults and raised NotImplementedError for anything else, set
    :browser_path to run Opera or Edge
  • cookie.sameparty? and same_party?, Chrome dropped SameParty cookies and they always returned nil

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot requested a review from laurent-martin as a code owner December 2, 2026 08:26

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants