> ## Documentation Index
> Fetch the complete documentation index at: https://docs.driver.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Window and display size

> windowSize sets the outer browser window; displaySize sets the virtual display behind it.

Both fields take `WIDTHxHEIGHT`, width 320 to 16384, height 200 to 16384.

| Field         | What it sets                                                               | Notes                                                               |
| ------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `windowSize`  | The outer Chrome window, what the page sees as `window.outerWidth/Height`. | Default depends on the machine.                                     |
| `displaySize` | The virtual display the window sits on.                                    | Leave it alone unless a site needs a screen larger than the window. |

<CodeGroup>
  ```json Request theme={"dark"}
  { "windowSize": "1920x1040", "displaySize": "1920x1080" }
  ```

  ```typescript TypeScript theme={"dark"}
  const session = await createSession({ windowSize: "1920x1040" });
  ```

  ```python Python theme={"dark"}
  session = create_session(windowSize="1920x1040")
  ```
</CodeGroup>

## Sizes people actually use

| `windowSize` | Looks like                                |
| ------------ | ----------------------------------------- |
| `1920x1040`  | Full HD desktop with a taskbar            |
| `1536x864`   | Scaled 1080p laptop                       |
| `1440x900`   | 13-inch MacBook                           |
| `1366x768`   | Budget laptop                             |
| `390x844`    | Phone-sized window (still desktop Chrome) |

Pick a size the session's machine would plausibly have. A `windowSize` larger than the display is clamped.

## Resizing after connecting

Set the size on create. `page.setViewportSize` (Playwright) and `page.setViewport` (Puppeteer) resize only the content area and leave `outerWidth` alone, a mismatch sites look for. Puppeteer applies an 800x600 viewport on connect unless you pass `defaultViewport: null`, so always pass it.
