Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions browse/src/browser-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ export class BrowserManager {

this.browser = await chromium.launch({
headless: useHeadless,
// Honor GSTACK_CHROMIUM_PATH on the headless launch path. The headed
// path (launchPersistentContext, below) already respects it; this keeps
// both modes consistent for custom Chromium builds — e.g. a NixOS system
// binary, where Playwright's bundled chrome-headless-shell can't run.
// No-op when the env var is unset.
...(process.env.GSTACK_CHROMIUM_PATH ? { executablePath: process.env.GSTACK_CHROMIUM_PATH } : {}),
// On Windows, Chromium's sandbox fails when the server is spawned through
// the Bun→Node process chain (GitHub #276). Disable it — local daemon
// browsing user-specified URLs has marginal sandbox benefit. Also disabled
Expand Down
8 changes: 7 additions & 1 deletion setup
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,13 @@ ensure_playwright_browser() {
else
(
cd "$SOURCE_GSTACK_DIR"
bun --eval 'import { chromium } from "playwright"; const browser = await chromium.launch(); await browser.close();'
if [ -n "$GSTACK_CHROMIUM_PATH" ]; then
# GSTACK_CHROMIUM_PATH set: verify that custom Chromium instead (e.g. a
# NixOS system binary, where Playwright's bundled Chromium can't run).
bun --eval 'import { chromium } from "playwright"; const browser = await chromium.launch({ executablePath: process.env.GSTACK_CHROMIUM_PATH, args: ["--no-sandbox"] }); await browser.close();'
else
bun --eval 'import { chromium } from "playwright"; const browser = await chromium.launch(); await browser.close();'
fi
) >/dev/null 2>&1
fi
}
Expand Down