是否有可能将浏览器(Chrome [ium])窗口大小设置为视口大小?
当brwoser没有无头运行时,只设置视口会导致不正常的外观,我想直观地看到浏览器实例中发生了什么.
所以我想要如下所示:
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
});
Run Code Online (Sandbox Code Playgroud)
感谢任何帮助我指向正确的方向