Playwright · Method
page.setViewportSize
Sets the viewport size for one Playwright page. Width and height are given in pixels.
Last updated
- Since
- v1.10
Syntax
page.setViewportSize(int width, int height);In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Browser.newContextBrowser.NewContextOptions.setViewportSizeviewportSizesetDeviceScaleFactorsetScreenSize