Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
interface Protocol.Page.VisualViewport
import { type Protocol } from "https://deno.land/x/pptr@1.2.0/vendor/devtools-protocol/protocol.d.ts";
const { VisualViewport } = Protocol.Page;

Visual viewport position, dimensions, and scale.

Properties

offsetX: number

Horizontal offset relative to the layout viewport (CSS pixels).

offsetY: number

Vertical offset relative to the layout viewport (CSS pixels).

pageX: number

Horizontal offset relative to the document (CSS pixels).

pageY: number

Vertical offset relative to the document (CSS pixels).

clientWidth: number

Width (CSS pixels), excludes scrollbar if present.

clientHeight: number

Height (CSS pixels), excludes scrollbar if present.

scale: number

Scale relative to the ideal viewport (size at width=device-width).

optional
zoom: number

Page zoom factor (CSS to device independent pixels ratio).