feat(browse): extend GSTACK_CHROMIUM_PATH support to headless launch#1614
Open
shohu wants to merge 1 commit into
Open
feat(browse): extend GSTACK_CHROMIUM_PATH support to headless launch#1614shohu wants to merge 1 commit into
shohu wants to merge 1 commit into
Conversation
launchHeaded() already reads GSTACK_CHROMIUM_PATH to select a custom Chromium binary, but launch() (headless mode, the default $B goto path) ignores the env var and always falls back to Playwright's bundled binary. This change applies the same pattern to launch(): if GSTACK_CHROMIUM_PATH is set and the path exists, pass it as executablePath to chromium.launch(). If unset or the binary is missing, falls back to standard Playwright Chromium automatically (existsSync guard). Motivation: enables drop-in use of stealth Chromium forks (e.g. CloakBrowser) for headless automation without forking gstack or patching vendored files.
8a119d8 to
16100e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
launchHeaded()already readsGSTACK_CHROMIUM_PATHto select a custom Chromium binary, butlaunch()(headless mode — the default$B gotopath) ignores the env var and always falls back to Playwright's bundled binary.This PR applies the same pattern to
launch():GSTACK_CHROMIUM_PATHis set and the path exists (existsSyncguard), it is passed asexecutablePathtochromium.launch()[browse] Using custom Chromium: <path>on startup when active (matches the debug style used elsewhere)Motivation
This enables drop-in use of stealth Chromium forks (e.g. CloakBrowser) for headless automation without needing to fork gstack or patch vendored files after every upgrade.
Before:
GSTACK_CHROMIUM_PATHonly worked for headed mode ($B connect). Headless$B gotoalways used Playwright's bundled binary regardless.After: Setting
GSTACK_CHROMIUM_PATHin the environment applies to both headless and headed mode consistently.Usage
Test plan
bun run buildpasses$B gotowithGSTACK_CHROMIUM_PATHset →navigator.webdriver: false,window.chrome: object$B gotowithoutGSTACK_CHROMIUM_PATH→ falls back to standard Playwright Chromium (existsSync guard)launchHeaded) behaviour🤖 Generated with Claude Code