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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for new Chromium 112 --headless=new flag, graphics stack enable/disable, lots of docs updates #76

Merged
merged 17 commits into from
Mar 27, 2023

Conversation

Sparticuz
Copy link
Owner

@Sparticuz Sparticuz commented Mar 24, 2023

Breaking changes:
Change to new headless version
Refactor default args, adding many that are default in puppeteer

Non-breaking changes:
Remove node version check and pull regex out into it's own function, fixes #75
Add ability to disable the graphics stack
Add docs on running headfully and running on arm
fixes #63
fixes #69
fixes #38
fixes #55
fixes #42
fixes #28
馃槂馃槂馃槂馃槂馃槂馃槂馃槂馃槂馃槂
More docs, fixes #77

Two new options are available

// True will be the 'old' headless mode, "new" is the new headless mode. "new" is the default
chromium.setHeadlessMode = true | "new";
// true will enable swiftshader and webgl, false disables it. true is the default
chromium.setGraphicsMode = true | false;

These need to be set before launching puppeteer

source/index.ts Outdated Show resolved Hide resolved
source/index.ts Outdated Show resolved Hide resolved
source/index.ts Outdated
* If true, the graphics stack and webgl is enabled,
* If false, webgl will be disabled. (If false, the swiftshader driver will also not extract)
*/
static graphicsStackMode: boolean = true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that in serverless environments we need to use swiftshader to use CPU only but we are now introducing a new configuration mode which would can disable webgl.

Would it make sense here to have the mode to have type of "swiftshader" | "swiftshader-webgl" | "webgl-disabled"?

the new option would be to use swiftshader to render webgl content, or ultimately disable webgl completely.

If the intention is to have an actual boolean maybe we can use something like graphicsStackEnabled?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for most users, swiftshader can be disabled and not used at all, it saves at least a full second on my testing for initial extracts. Swiftshader/angle is what powers webgl, so I'm not sure what the difference would be for swiftshader or swiftshader-webgl (Maybe my comment was confusing about the swiftshader driver)

@Sparticuz
Copy link
Owner Author

Thanks for the comments!

@Sparticuz Sparticuz changed the title Support for new Chromium 112 --headless=new flag Support for new Chromium 112 --headless=new flag, graphics stack enable/disable, lots of docs updates Mar 27, 2023
@Sparticuz Sparticuz merged commit 852a34f into master Mar 27, 2023
4 checks passed
@Sparticuz Sparticuz deleted the refactor-args branch July 24, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment