Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support chrome-headless-shell (old headless mode) #918

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vintagesucks
Copy link

@vintagesucks vintagesucks commented Jan 30, 2025

headless: request.options.newHeadless ? 'new' : true,

In current Puppeteer versions (v22+ according to the docs), {headless: true} actually launches the new headless mode, while {headless: 'shell'} launches the old mode:

This makes it currently impossible to use the old headless mode with Browsershot, which is our preferred mode for creating PDFs, and the only mode that, in our experience, actually works with Basic Auth.

See https://developer.chrome.com/blog/chrome-headless-shell for more details.


Note: We were previously able to work around this issue by enabling the old headless mode the following way instead:

$browsershot->addChromiumArguments([
    'headless' => 'old', // see https://developer.chrome.com/docs/chromium/headless#use_old_headless_mode
]);

As of Puppeteer v24.1.0, this workaround unfortunately does not work anymore, as old is not a valid option anymore:

================ Error Output: ================
sh: npm: command not found Error: Failed to launch the browser process!

Old Headless mode has been removed from the Chrome binary. Please use the 
new Headless mode (https://developer.chrome.com/docs/chromium/new-headless)
or the chrome-headless-shell which is a standalone implementation of the old
Headless mode (https://developer.chrome.com/blog/chrome-headless-shell).

TROUBLESHOOTING: https://pptr.dev/troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant