From c08c871b18514190e8e2b6f322b3d9c3b8c66fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B3=A2=E6=AF=94=E5=B0=8F=E9=87=91=E5=88=9A?= <2890636389@qq.com> Date: Mon, 29 Jan 2024 15:34:36 +0800 Subject: [PATCH] Use new Puppeteer headless mode (#117) Co-authored-by: Sindre Sorhus --- index.d.ts | 2 +- index.js | 2 +- readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.d.ts b/index.d.ts index 7adda02..cf929b9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -379,7 +379,7 @@ export type Options = { Note: Some of the launch options are overridden by the `debug` option. - @default {} + @default {headless: 'new'} */ readonly launchOptions?: PuppeteerLaunchOptions; diff --git a/index.js b/index.js index 5d76b92..6bc07e9 100644 --- a/index.js +++ b/index.js @@ -139,7 +139,7 @@ const parseCookie = (url, cookie) => { const internalCaptureWebsite = async (input, options) => { options = { - launchOptions: {}, + launchOptions: {headless: 'new'}, ...options, }; const {launchOptions} = options; diff --git a/readme.md b/readme.md index 211abd0..ac25285 100644 --- a/readme.md +++ b/readme.md @@ -454,7 +454,7 @@ await captureWebsite.file('index.html', 'screenshot.png', { ##### launchOptions Type: `object`\ -Default: `{}` +Default: `{headless: 'new'}` Options passed to [`puppeteer.launch()`](https://pptr.dev/api/puppeteer.puppeteernodelaunchoptions).