Unused window space in puppeteer (non-headless)

Viewed 109

I am running puppeteer in non-headless mode and for most of the pages right part of the Chrome window is unused/blank:

enter image description here

Although I am not sure of this, but It looks like this space is supposed to be occupied by dev tools but no dev tools are actually opened.

This is how I start puppeteer (nothing fancy):

  const browser = await launch({
    headless: false,
    args: [
      "--start-maximized"
    ]
  })

Any idea of the cause and how to fix this "dead" ui space?

1 Answers

The default viewport dimension in puppeteer is 800x600 pixels. You can change it:

const page = await browser.newPage();
await page.setViewport({
  width: 1920,
  height: 1080,
});
Related