From 8643fc66ebdc7c11f77cc217ff987d3d5d3900e8 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov Date: Wed, 19 Apr 2023 12:47:43 +0200 Subject: [PATCH] chore: fix --- README.md | 18 +++++++++++------- docs/index.md | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index dc0754adecc68..4125e9993572c 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ > Chrome/Chromium over the > [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/). > Puppeteer runs in -> [headless](https://developers.google.com/web/updates/2017/04/headless-chrome) +> [headless](https://developer.chrome.com/articles/new-headless/) > mode by default, but can be configured to run in full (non-headless) > Chrome/Chromium. @@ -177,20 +177,24 @@ import puppeteer from 'puppeteer'; **1. Uses Headless mode** By default Puppeteer launches Chromium in -[headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). +[old headless mode](https://developer.chrome.com/articles/new-headless/). -> Note: Deprecated please consider using `headless: 'new'` -> See example bellow. +```ts +const browser = await puppeteer.launch(); +// Equivalent to +const browser = await puppeteer.launch({headless: true}); +``` -This behavior will change in the feature with the introduction of [--headless=new](https://developer.chrome.com/articles/new-headless/). -You can already try it out: +[Chrome 112 launched a new Headless mode](https://developer.chrome.com/articles/new-headless/) that might cause some differences in behavior compared to the old Headless implementation. +In the future Puppeteer will start defaulting to new implementation. +We recommend you try it out before the switch: ```ts const browser = await puppeteer.launch({headless: 'new'}); ``` To launch a full version of Chromium, set the -[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions) +[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions) to `"true"` option when launching a browser: ```ts diff --git a/docs/index.md b/docs/index.md index dc0754adecc68..4125e9993572c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,7 +11,7 @@ > Chrome/Chromium over the > [DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/). > Puppeteer runs in -> [headless](https://developers.google.com/web/updates/2017/04/headless-chrome) +> [headless](https://developer.chrome.com/articles/new-headless/) > mode by default, but can be configured to run in full (non-headless) > Chrome/Chromium. @@ -177,20 +177,24 @@ import puppeteer from 'puppeteer'; **1. Uses Headless mode** By default Puppeteer launches Chromium in -[headless mode](https://developers.google.com/web/updates/2017/04/headless-chrome). +[old headless mode](https://developer.chrome.com/articles/new-headless/). -> Note: Deprecated please consider using `headless: 'new'` -> See example bellow. +```ts +const browser = await puppeteer.launch(); +// Equivalent to +const browser = await puppeteer.launch({headless: true}); +``` -This behavior will change in the feature with the introduction of [--headless=new](https://developer.chrome.com/articles/new-headless/). -You can already try it out: +[Chrome 112 launched a new Headless mode](https://developer.chrome.com/articles/new-headless/) that might cause some differences in behavior compared to the old Headless implementation. +In the future Puppeteer will start defaulting to new implementation. +We recommend you try it out before the switch: ```ts const browser = await puppeteer.launch({headless: 'new'}); ``` To launch a full version of Chromium, set the -[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions) +[`headless`](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions) to `"true"` option when launching a browser: ```ts