Skip to main content
Set custom browser window dimensions for your sessions.

Setting Window Size

Specify dimensions as WIDTHxHEIGHT:
const session = await client.browser.session.create({
  windowSize: "1920x1080",
});

Common Resolutions

ResolutionAspect RatioUse Case
1920x108016:9Desktop Full HD
1366x76816:9Common laptop
1536x86416:9Scaled laptop
1440x90016:10MacBook
1280x72016:9HD
390x844~9:19.5iPhone 14
360x8009:20Android mobile

Dynamic Resizing

You can also resize the viewport after connecting:
await page.setViewportSize({ width: 1920, height: 1080 });

Notes

  • Window size affects the initial browser window dimensions
  • Some sites detect and respond to viewport size
  • For responsive testing, combine with framework viewport controls
  • Default size varies by node if not specified