Skip to content

fix: support resize_page when browser window is maximized/fullscreenwindow state#748

Merged
OrKoN merged 11 commits intoChromeDevTools:mainfrom
0xlakshan:resize_bug_465
Jan 13, 2026
Merged

fix: support resize_page when browser window is maximized/fullscreenwindow state#748
OrKoN merged 11 commits intoChromeDevTools:mainfrom
0xlakshan:resize_bug_465

Conversation

@0xlakshan
Copy link
Contributor

@0xlakshan 0xlakshan commented Jan 9, 2026

Related Issue - 465

Description

This change make sure that the browser window is restored to a normal state before resizing the page. When the window is in fullscreen mode we have to set the state twice to match how Chrome CDP behaves.

Tests cover window resizing for every available window states type WindowState = 'normal' | 'minimized' | 'maximized' | 'fullscreen';

@0xlakshan 0xlakshan marked this pull request as ready for review January 10, 2026 18:39
@OrKoN OrKoN self-requested a review January 12, 2026 08:47
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
@OrKoN OrKoN changed the title feat: support resize_page when browser window is maximized/fullscreenwindow state fix: support resize_page when browser window is maximized/fullscreenwindow state Jan 12, 2026
@OrKoN
Copy link
Collaborator

OrKoN commented Jan 12, 2026

I guess might require setting a larger screen info for the test browser similar to https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/browser.ts#L178

@0xlakshan
Copy link
Contributor Author

After testing few times i noticed that the maximized and fullscreen tests often fail, with dimensions overlapping those of the previous tests.

I think this happens because Chrome is still resizing from the previous test when the next test starts, and the resize listener resolves on the previous resize event rather than the current one.

To fix this, I found that the puppeteer's Page.waitForFunction() method can be used to wait until the size dimensions are actually being set

@OrKoN
Copy link
Collaborator

OrKoN commented Jan 13, 2026

Thanks!

@OrKoN OrKoN added this pull request to the merge queue Jan 13, 2026
Merged via the queue into ChromeDevTools:main with commit 4d9ac22 Jan 13, 2026
17 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jan 15, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.13.0](chrome-devtools-mcp-v0.12.1...chrome-devtools-mcp-v0.13.0)
(2026-01-14)


### 🎉 Features

* Allow opting out of default Chrome launch arguments
([#729](#729))
([9a51af2](9a51af2))
* support filePath in performance tools
([#686](#686))
([68ae2f8](68ae2f8))


### 🛠️ Fixes

* support resize_page when browser window is maximized/fullscreenwindow
state
([#748](#748))
([4d9ac22](4d9ac22))
* use relative path for plugin source in marketplace
([#724](#724))
([5c1ecf8](5c1ecf8))


### 📄 Documentation

* add experimental chrome on android guide
([#691](#691))
([4a87702](4a87702))
* autoConnect - clarify how the mcp server selects a profile
([#693](#693))
([28b8ff8](28b8ff8))
* claude code broken link
([#707](#707))
([1f532b8](1f532b8))
* enhance cli docs + sort required vs opt params
([#674](#674))
([81cbd99](81cbd99))
* update auto connect docs to mention min Chrome version
([#681](#681))
([ab2340f](ab2340f))
* Update Claude Code instructions in README.md
([#711](#711))
([f81cd2d](f81cd2d))
* update readme to include OpenCode example
([#560](#560))
([fbba3c9](fbba3c9))


### ♻️ Chores

* change pageIdx to page ids
([#741](#741))
([a23c6ba](a23c6ba))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Copy link

@zainudinmuji4-commits zainudinmuji4-commits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.github/dependabot.yml

Copy link

@zainudinmuji4-commits zainudinmuji4-commits left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

frontend/eslint.config.mjs

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.

3 participants