Skip to content

Resize the window over BiDi so it survives page closes (#346) - #347

Merged
vincebln2 merged 1 commit into
VibiumDev:mainfrom
vincebln2:fix/346-window-resize-after-page-close
Aug 10, 2026
Merged

Resize the window over BiDi so it survives page closes (#346)#347
vincebln2 merged 1 commit into
VibiumDev:mainfrom
vincebln2:fix/346-window-resize-after-page-close

Conversation

@vincebln2

Copy link
Copy Markdown
Collaborator

Fixes #346.

Setting the window size used the classic WebDriver window/rect endpoint, which acts on the driver session's current window handle. That handle never moves off the first window: BiDi page switches and closes do not resync it, so closing the original page broke every later resize while vibium window reads kept working over BiDi. Resize now sends browser.setClientWindowState, matching the read path, and picks the focused client window.

Reading the window also prefers the focused client window now instead of always the first one, since both paths share activeClientWindow.

With the classic dependency gone, the remote-browser guard is removed too, so resize works in connect mode; the daemon connect test now asserts success instead of the old error. ChromedriverPost had no remaining callers and is deleted.

tests/cli/viewport-window.test.js was never referenced by the Makefile and had never run in CI. It is added to CLI_CORE_TESTS with a new regression test for the close-then-resize sequence.

Verified:

  • Regression test fails on main, passes with the fix
  • CLI repro from the issue passes on Chrome and Firefox locally
  • Full make test green on Chrome (7m27s)
  • Full viewport-window.test.js green under ENGINE=firefox locally

Setting the window size went through the classic WebDriver window/rect
endpoint, which acts on the driver session's current window handle. That
handle never moves off the first window, so closing that page broke every
later resize. Send browser.setClientWindowState instead, matching how
reading the window already works.

The remote-browser guard falls away with the classic dependency, so
window resize now also works in connect mode. The regression test file
was never referenced by the Makefile; add it to CLI_CORE_TESTS so it
runs.
@vincebln2
vincebln2 merged commit 4465a8e into VibiumDev:main Aug 10, 2026
1 check passed
@vincebln2
vincebln2 deleted the fix/346-window-resize-after-page-close branch August 10, 2026 22:06
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.

vibium window <w> <h> fails with no such window` after the original page is closed

1 participant