mirror of https://github.com/garrytan/gstack.git
Merge 77da206a24 into a3259400a3
This commit is contained in:
commit
8a0f7ffa91
|
|
@ -371,6 +371,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
|
||||
|
|
|
|||
8
setup
8
setup
|
|
@ -260,7 +260,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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue