Skip to content

IBrowserPageViewport

David Ortner edited this page Apr 6, 2024 · 2 revisions

IBrowserPageViewport represents the page viewport.

Signature

interface IBrowserPageViewport

Example

import { Browser } from "happy-dom";

const browser = new Browser();
const page = browser.newPage();

page.setViewport({
   width: 800,
   height: 600,
   devicePixelRatio: 2,
});

Properties

Property Type Description
width number Page width.
height number Page height.
devicePixelRatio number Device pixel ratio.
Clone this wiki locally