Repository navigation
Conversation
…ssing Ferrum::Page Cuprite::Page overrode Ferrum::Page's private subscribe and prepare_page, and attach_page built it through Target's private maybe_sleep_if_new_window and page=. Browser now registers one on_page block that sets every page up with Ferrum's public API, and keeps the frame stack and the dialog queue in a PageState per target. - Browser delegates the DOM and JavaScript methods to the frame switched to, and overrides go_to and set_viewport for the pending connections error and the scale_factor: and mobile: defaults - resize applies those defaults again, since Ferrum's Page#resize sets the viewport without them - An unhandled dialog's error is raised around the Driver and Node calls instead of around every page command
… in the driver Cuprite::Browser subclassed Ferrum::Browser to keep the current window, the per-page frames and dialogs, the settings and the page setup. The driver keeps them now, so driver.browser is a plain Ferrum::Browser whose page is the first window. - Driver#current_page is the window Capybara switched to, and Driver#window(page) holds its frame stack and dialog queue - The window handle methods move to Driver::Windows, the settings to Driver::Settings - url_blocklist=, url_allowlist=, their aliases and raise_on_unhandled_modal= move from driver.browser to driver - Driver#reset! restarts a browser that died, Browser#command did it before
route
marked this pull request as ready for review
November 26, 2026 19:39
This was referenced Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds against Ferrum main, which has
on_page(rubycdp/ferrum#735) and noTarget#page=(rubycdp/ferrum#736).Cuprite::Page < Ferrum::PageandCuprite::Browser < Ferrum::Browserare gone.driver.browseris a plainFerrum::Browser, like Selenium's raw driver, and the driver keeps what Capybara needs on top:on_pageblock that sets up every page Ferrum builds (default page,create_page, popups) before Ferrum hands it out: extension JS, viewport, device user agent, URL lists, JS errors.Driver#current_pageis the window Capybara switched to, Ferrum'sbrowser.pageuntil it switches.Driver#window(page)holds a page's frame stack and dialog queue (Driver::Window).Driver::Windows, the settings inDriver::Settings.window.active_frame, and mouse, keyboard and navigation oncurrent_page.visitraisesPendingConnectionsErrorthrough Ferrum'sgo_to!andNavigationTimeoutError#pendings.Behavior changes:
url_blocklist=,url_allowlist=, their aliases andraise_on_unhandled_modal=moved frompage.driver.browsertopage.driver.page.driver.browser.*runs in the first window, also insidewithin_window. The switched-to window ispage.driver.current_page.reset!, between tests, instead of by the command that found it dead.UnhandledModalErroris raised around the Driver calls (visit,find,evaluate_script,execute_script, ...) and Node calls (command, the click), instead of around every page command.js_errorssubscription starts after Ferrum'sRuntime.enableinstead of before it, so an exception in that short window on a page whose scripts were already running (a popup) isn't raised.