When I run a new page, I must specify size of the viewport using the setViewport
function:
await page.setViewport({
width: 1920,
height: 1080
})
I want use max viewport.
How can I make the viewport resizable according to the window size?
I may be very late on this. Nevertheless for others, try:
const browser = await puppeteer.launch({defaultViewport: null});
Set the defaultViewport
option to null
as above to disable the 800x600 resolution. It takes the max resolution then.