jeudi 8 février 2018

Set pupeteer window size when running not headless (not viewport)

Is it somehow possible to set the browsers (Chrome[ium]) window size like the viewport size?

Setting only the view port results in a unhandy appearance when the brwoser is not running headless and I want to visually see what's going on within the browser instance.

So I would like something like below:

const browser = await puppeteer.launch({
      headless: false, // The browser is visible
      ignoreHTTPSErrors: true
}),
page = await browser.newPage();


// This is well explained in the API
await page.setViewport({
    width: options.width,
    height: options.height
});

// But is there something like this (careful this is dummy code)
browser.setWindowSize({
    width: options.width,
    height: options.height
});

Thanks for any help pointing me into hte right direction

Aucun commentaire:

Enregistrer un commentaire