Skip to content

Conversation

ash-plunkett-alliance
Copy link

@ash-plunkett-alliance ash-plunkett-alliance commented Mar 4, 2025

Playwright 1.49.0+ has rolled in Chrome 112's changes to their headless browser.

Chrome blog: https://developer.chrome.com/blog/chrome-headless-shell

Related playwright issue/explainer: microsoft/playwright#33566

What this actually means is that playwright install chromium installs both full Chromium, as well as Chromium Headless Shell.

At the time of writing, that comes out to ~199mb. I only first noticed this after upgrading playwright because Heroku was rejecting the build for exceeding the 500mb slug limit.

After digging around, instead of playwright install chromium, we should now be using playwright install chromium-headless-shell (or playwright install chromium --only-shell, appears to be the same thing) if we don't want full Chromium. This'll install only the headless version, ~77mb at the time of writing.

Unfortunately it's not as simple as just doing that though. The executable for the headless Chromium isn't called just chrome, it's called headless_shell - which means that CHROMIUM_EXECUTABLE_PATH isn't automatically set by this buildpack anymore if you only need the headless version installed.

All this PR does is update the compile script; if chrome isn't found, then it looks for headless_shell - and if that's found, then it sets CHROMIUM_EXECUTABLE_PATH to that.

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