Skip to content

Lupa API Reference / commands / setViewport

Function: setViewport() ​

setViewport(viewport): Promise<void>

Defined in: src/commands/index.ts:44

Sets the viewport size of the browser.

Parameters ​

viewport ​

Viewport

The viewport size.

Returns ​

Promise<void>

A promise that resolves when the viewport size is set.

Example ​

ts
   await setViewport({
       width: 1024,
       height: 768,
   })

Deprecated ​

Use the emulation instance instead (e.g., await emulation.setViewport(...)).