Repository navigation
feat(context): open a window instead of a tab with new_window: - #733
Merged
Merged
Conversation
Target.createTarget opens a tab in the window Chrome last opened for the context unless newWindow is set. create_target and create_page of a context and of the browser take new_window: to pass it, so Capybara drivers can implement open_new_window(:window).
route
force-pushed
the
feat/new-window
branch
from
November 25, 2026 09:09
723bc78 to
8b75eea
Compare
route
added a commit
to rubycdp/cuprite
that referenced
this pull request
Nov 25, 2026
…ndow) Capybara passes the kind only to a driver whose open_new_window takes an argument, so :window opened a tab. It now calls create_target(new_window: true). Ferrum 0.21 doesn't take new_window: yet, so Cuprite prepends rubycdp/ferrum#733's create_target to Ferrum::Context unless Ferrum's already takes it. A kind other than :tab and :window raises ArgumentError.
route
added a commit
to rubycdp/cuprite
that referenced
this pull request
Nov 25, 2026
…ndow) (#384) Capybara passes the kind only to a driver whose open_new_window takes an argument, so :window opened a tab. It now calls create_target(new_window: true). Ferrum 0.21 doesn't take new_window: yet, so Cuprite prepends rubycdp/ferrum#733's create_target to Ferrum::Context unless Ferrum's already takes it. A kind other than :tab and :window raises ArgumentError.
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.
Target.createTargetopens a tab in the window Chrome last opened for the context unlessnewWindow: trueis passed, and Ferrum had no way to pass it. Cuprite needs it to implement Capybara'sopen_new_window(:window), which now always opens a tab.Context#create_target(new_window: false)sendsnewWindow: truewhen asked.Context#create_pageandBrowser#create_pagetakenew_window:and pass it on.Browser#create_targetgets it through the existing delegation to the default context.Browser.getWindowForTargetids. A tab shares the window of the context's first target, andnew_window: truegets a window of its own. The twonew_window:examples fail without the change, and the tab example is the baseline. I checked this headless and headed.