const browser = await puppeteer.launch({
headless: false,
defaultViewport: { width: 1440, height: 1000 },
ignoreHTTPSErrors: true,
args: [`--window-size=${1440},${1000}`], // new option
});
Copy the code
DefaultViewport cannot be set at startup. The browser window size remains the same. In args, set ‘–window-size’.
Source address: www.jianshu.com/p/136a61a68…