Skip to content

Implement Page.ResizeAsync#3130

Merged
kblok merged 5 commits intomasterfrom
implement-upstream-change-14525
Feb 13, 2026
Merged

Implement Page.ResizeAsync#3130
kblok merged 5 commits intomasterfrom
implement-upstream-change-14525

Conversation

@kblok
Copy link
Member

@kblok kblok commented Feb 13, 2026

Summary

  • Adds ResizeAsync(int contentWidth, int contentHeight) to IPage and Page (abstract)
  • Implements CDP version in CdpPage using Browser.getWindowForTarget and Browser.setContentsSize
  • Adds NotSupportedException stub in BidiPage (matching upstream which throws "Method not implemented for WebDriver BiDi yet")
  • Adds test from upstream page.spec for Page.resize
  • Test is skipped via TestExpectations.local.json because Browser.setContentsSize is not yet available in Chrome 138 (upstream uses Chrome 145+)

Changes

File Change
IPage.cs Added ResizeAsync method to interface
Page.cs Added abstract ResizeAsync method
CdpPage.cs CDP implementation using Browser.getWindowForTarget + Browser.setContentsSize
BidiPage.cs Throws NotSupportedException
BrowserGetWindowForTargetResponse.cs New CDP messaging class
BrowserSetContentsSizeRequest.cs New CDP messaging class
SystemTextJsonSerializationContext.cs Registered new messaging types for AOT
ResizeTests.cs Test ported from upstream
TestExpectations.local.json Skip entries for Chrome CDP (pending Chrome update) and BiDi

Upstream PR

puppeteer/puppeteer#14525

Test plan

  • Build succeeds with no errors
  • All existing PageTests pass (143 passed, 5 skipped)
  • New resize test is properly skipped via test expectations
  • When Chrome is updated to support Browser.setContentsSize, remove the skip entry and verify the test passes

🤖 Generated with Claude Code

kblok and others added 5 commits February 13, 2026 10:08
Add ResizeAsync method to IPage/Page that resizes the browser window
content area to specified dimensions using Browser.getWindowForTarget
and Browser.setContentsSize CDP commands.

Test is skipped until Chrome is updated to a version that supports
Browser.setContentsSize.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move resize BiDi skip expectation from local to upstream.json to
match upstream TestExpectations. Add local skip for
ShouldTriggerCorrectLog which changed CORS error message in Chrome 145.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Split SharedWorker/ServiceWorker close logic in CdpWebWorker to match
  upstream (SharedWorker only closes target, no detach) and add null
  guards on Connection
- Update tracing test to verify traceEvents categories instead of
  removed trace-config metadata
- Fix request interception tests to use server page instead of data: URL
  and filter favicon requests, matching upstream
- Increase OOPIF frame wait timeout for cross-process frame creation on
  slower CI machines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant