Skip to content

Fix worker targets counted as browser windows - #332

Closed
sean0407 wants to merge 1 commit into
rubycdp:mainfrom
sean0407:codex/window-handles-ignore-non-pages
Closed

sean0407 wants to merge 1 commit into
rubycdp:mainfrom
sean0407:codex/window-handles-ignore-non-pages

Conversation

@sean0407

Copy link
Copy Markdown

Summary

window_handles
- before: return every tracked CDP target
+ after: return only IDs for `page` targets

Fixes #326. Ferrum 0.18 tracks page, iframe, worker, shared-worker, and service-worker targets; only page targets are browser windows.

Evidence

  • Before: The new worker-window regression example failed on the original implementation: expected 1 handle, got 2.
  • After: The regression example and existing window-listing example passed (2 examples, 0 failures). The full spec/features/driver_spec.rb passed (156 examples, 0 failures, 6 pending).
  • bundle exec rubocop lib/capybara/cuprite/browser.rb spec/features/driver_spec.rb: 2 files inspected, no offenses.

Merge Danger

Door: Two-way

Blast Radius: Low

Only window-handle enumeration changes; non-page CDP targets are excluded while page targets and existing popup behavior remain covered by specs.

@route

route commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thanks, I just prepared mine yesterday #333

@route route closed this Oct 14, 2026
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.

window_handles counts worker targets as windows since Ferrum 0.18, breaking window_opened_by

2 participants