puppeteer/website/versioned_docs/version-22.10.0/guides/headless-modes.md
release-please[bot] d963fcdd80
chore: release main (#12456)
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
2024-05-24 07:26:52 +00:00

1.1 KiB

Headless mode

By default Puppeteer launches the browser in the Headless mode.

const browser = await puppeteer.launch();
// Equivalent to
const browser = await puppeteer.launch({headless: true});

Before v22, Puppeteer launched the old Headless mode by default. The old headless mode is now known as chrome-headless-shell and ships as a separate binary. chrome-headless-shell does not match the behavior of the regular Chrome completely but it is currently more performant for automation tasks where the complete Chrome feature set is not needed. If the performance is more important for your use case, switch to chrome-headless-shell as following:

const browser = await puppeteer.launch({headless: 'shell'});

To launch a "headful" version of Chrome, set the headless to false option when launching a browser:

const browser = await puppeteer.launch({headless: false});