Resize the window over BiDi so it survives page closes (#346) - #347
Merged
vincebln2 merged 1 commit intoAug 10, 2026
Merged
Conversation
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.
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.
Fixes #346.
Setting the window size used the classic WebDriver
window/rectendpoint, 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 whilevibium windowreads kept working over BiDi. Resize now sendsbrowser.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.
ChromedriverPosthad no remaining callers and is deleted.tests/cli/viewport-window.test.jswas never referenced by the Makefile and had never run in CI. It is added toCLI_CORE_TESTSwith a new regression test for the close-then-resize sequence.Verified:
make testgreen on Chrome (7m27s)viewport-window.test.jsgreen underENGINE=firefoxlocally