Skip to content

fix(browser): list only page targets as window handles - #333

Merged
route merged 1 commit into
mainfrom
worktree-fix-worker-window-handles
Oct 14, 2026
Merged

route merged 1 commit into
mainfrom
worktree-fix-worker-window-handles

Conversation

@route

@route route commented Oct 14, 2026

Copy link
Copy Markdown
Member

Fixes #326

Ferrum 0.18 tracks worker, shared_worker and service_worker targets in the same map as pages, so window_handles reported a page's web workers as windows and window_opened_by raised opened 2 windows instead of 1.

  • window_handles returns only page targets
  • switch_to_window and close_window raise Ferrum::NoSuchPageError for non-page targets instead of opening a page session on a worker
  • regression spec with a fixture that spawns a dedicated worker on load and opens a target=_blank tab; it fails on main with expected: 1, got: 2

Ferrum 0.18 tracks worker, shared_worker and service_worker targets alongside pages, so window_handles reported a page's web workers as windows and window_opened_by raised "opened 2 windows instead of 1". switch_to_window and close_window now also reject non-page targets. Fixes #326
@route
route merged commit 91a9d0a into main Oct 14, 2026
7 checks passed
@route
route deleted the worktree-fix-worker-window-handles branch October 14, 2026 07:48
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

1 participant