mirror of
https://github.com/hanzoai/puppeteer.git
synced 2026-09-24 17:02:14 +00:00
feat: publish page.resize() (#14525)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
{ contentWidth: number; contentHeight: number; }
|
||||
|
||||
</td><td>
|
||||
|
||||
</td></tr>
|
||||
</tbody></table>
|
||||
|
||||
**Returns:**
|
||||
|
||||
Promise<void>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user