marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.9k stars 108 forks source link

Support Puppeteer's new headless mode by `PUPPETEER_HEADLESS_MODE=new` env #508

Closed yhatt closed 1 year ago

yhatt commented 1 year ago

The latest Puppeteer allows headless: 'new' option to use more compatible browser rendering that is same as the headful mode. https://developer.chrome.com/articles/new-headless/

For the time being at least, Marp CLI can unlock the new headless mode an environment value PUPPETEER_HEADLESS_MODE=new.

PUPPETEER_HEADLESS_MODE=new marp ./new-headless.md --pdf

If it became stable, we will change the default headless mode to new. If so, users would need to opt-in for using legacy headless mode via PUPPETEER_HEADLESS_MODE=old.