Repository navigation
Conversation
Add two no-op-by-default launch overrides so users can customize the browse server's Chromium without patching the source (which is wiped on every `/gstack-upgrade`): - GSTACK_CHROMIUM_ARGS: extra Chromium flags appended to the launch args. Accepts a JSON array of strings or a whitespace-separated string. - GSTACK_HTTP_CREDENTIALS: "user:pass" basic-auth, auto-answers 401 challenges (e.g. a dev environment behind a shared gate). Both default to a no-op, so out-of-the-box launch behavior is unchanged. Parsing lives in a small pure module (browse/src/launch-overrides.ts) mirroring the existing GSTACK_CLAUDE_BIN_ARGS pattern, with unit tests. Wired into all three launch paths: headless launch(), headed launchHeaded(), and the headless→headed handoff re-launch. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
The parsing helpers are clean and well-covered by 1. Security — 2. Coordination. This overlaps #1968 ( |
|
@16francej not needed close agent does this for you |
|
Thank you for this, @jeanfw. It's a reasonable idea, but not one we can take right now: An extra-args escape hatch is reasonable only with a denylist (for example --remote-debugging-port and --disable-web-security undo the browse security model). Basic-auth credentials belong in a scoped |
What
Two no-op-by-default launch overrides for the browse server's Chromium, read from the environment so users can customize the browser without patching the source (which
/gstack-upgradewipes viagit reset --hard):GSTACK_CHROMIUM_ARGS— extra Chromium command-line flags appended to the launch args. Accepts a JSON array of strings ('["--mute-audio", "--use-fake-ui-for-media-stream"]') or a whitespace-separated string ('--flag-a --flag-b').GSTACK_HTTP_CREDENTIALS— HTTP basic-auth as"user:pass", auto-answers 401 challenges (e.g. a dev environment behind a shared gate). Splits on the first colon so passwords may contain colons.Both default to a no-op, so out-of-the-box launch behavior is unchanged.
Why
There's currently no supported way to add Chromium flags or basic-auth credentials to the headed/headless browser. The only option is editing
browser-manager.tsdirectly, and that edit is lost on every upgrade. This mirrors the existingGSTACK_CLAUDE_BIN_ARGSenv-override pattern (JSON-array-or-scalar) so the convention is consistent.How
browse/src/launch-overrides.ts(parseExtraChromiumArgs,parseHttpCredentials) with unit tests.launch(), headedlaunchHeaded(), and the headless→headed handoff re-launch.Tests
bun test browse/test/launch-overrides.test.ts— 13 assertions covering JSON-array, whitespace-split, single-flag, empty-drop, colon-in-password, and the unset/blank/no-colon no-op cases.🤖 Generated with Claude Code