puppeteer / puppeteer

JavaScript API for Chrome and Firefox
https://pptr.dev
Apache License 2.0
88.02k stars 9.05k forks source link

[Bug]: Extensions in headless #8173

Closed JiriValasek closed 7 months ago

JiriValasek commented 2 years ago

Bug description

Dear puppeteer makers,

I'm not sure if it's really a big, but would it be possible to use the --headless=chrome switch instead of --headless, which supports extensions in headless mode.

Puppeteer version

13.1.3

Node.js version

16.13.2

npm version

8.1.3

What operating system are you seeing the problem on?

Linux

Relevant log output

No response

OrKoN commented 2 years ago

It's more of a feature request. The new headless mode is kind of experimental for Puppeteer as not all tests pass yet. I am adding the support here https://github.com/puppeteer/puppeteer/pull/8260.

Kikobeats commented 2 years ago

@OrKoN It's hard to know what 'chrome' implies without checking the PR.

I think this sentence should be added at documentation just to clarify:

'chrome' means to support extensions in headless mode.

OrKoN commented 2 years ago

'chrome' does not only means extensions, it means that the same Chrome browser implementation runs in the headless mode. The old headless was a custom browser implementation, that's why it didn't have extensions and other Chrome features. We will make the documents more clear once it is more stable!

mxr commented 1 year ago

Is there anywhere I can learn more about the differences between --headless and --headless=chrome, specifically performance differences? I was only able to find these docs which don't mention --headless=chrome

OrKoN commented 1 year ago

@mxr it's not publicly documented yet but I am told some public documentation is coming in the next months. In general, the performance of the new headless should be the same as the performance of the headful browser.

mxr commented 1 year ago

Thanks!

Lightning00Blade commented 7 months ago

Puppeteer already has the option for utilizing headless: 'new', and has documentation for it here - https://pptr.dev/guides/chrome-extensions Announcement - https://developer.chrome.com/docs/chromium/new-headless