feat: publish page.resize() (#14525)

This commit is contained in:
Alex Rudenko
2025-12-18 19:24:48 +01:00
committed by GitHub
parent 0f192cbc18
commit f6af874759
3 changed files with 63 additions and 3 deletions
+11
View File
@@ -960,6 +960,17 @@ Removes script that injected into page by Page.evaluateOnNewDocument.
</td></tr>
<tr><td>
<span id="resize">[resize(params)](./puppeteer.page.resize.md)</span>
</td><td>
</td><td>
**_(Experimental)_** Resizes the browser window of this page so that the content area (excluding browser UI) has the specified width and height.
</td></tr>
<tr><td>
<span id="screencast">[screencast(options)](./puppeteer.page.screencast.md)</span>
</td><td>
+50
View File
@@ -0,0 +1,50 @@
---
sidebar_label: Page.resize
---
# Page.resize() method
Resizes the browser window of this page so that the content area (excluding browser UI) has the specified width and height.
### Signature
```typescript
class Page {
abstract resize(params: {
contentWidth: number;
contentHeight: number;
}): Promise<void>;
}
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
params
</td><td>
&#123; contentWidth: number; contentHeight: number; &#125;
</td><td>
</td></tr>
</tbody></table>
**Returns:**
Promise&lt;void&gt;
+2 -3
View File
@@ -3154,11 +3154,10 @@ export abstract class Page extends EventEmitter<PageEvents> {
): Promise<DeviceRequestPrompt>;
/**
* Resizes the browser window the page is in so that the content area
* (excluding browser UI) is according to the specified width and height.
* Resizes the browser window of this page so that the content area (excluding
* browser UI) has the specified width and height.
*
* @experimental
* @internal
*/
abstract resize(params: {
contentWidth: number;