How can I define a maximum viewport size in Puppeteer?

When I create a new page, I need to define the viewport dimensions with the adjustViewport method:

await page.adjustViewport({
    width: 1440,
    height: 900
});

I would like to implement a max viewport configuration.

What steps should I take to enable the viewport to adjust dynamically to the window size?

hey, u could maybe try using setViewport and listen for ‘resize’ events. when the window resizes, just reapply the size limits by adjusting the width and height dynamically based on constraints you set. hope this helps!