From 82bedb0212262063493c22aae2fe3d832b96864e Mon Sep 17 00:00:00 2001 From: Slava Date: Thu, 11 Jun 2026 07:23:30 +0000 Subject: [PATCH] fix(browse): honor GSTACK_CHROMIUM_PATH in headless launch() The headed launchPersistentContext() path already honors GSTACK_CHROMIUM_PATH, but the headless chromium.launch() path did not. On NixOS the bundled Playwright chrome-headless-shell is FHS-linked and can't load its shared libs, so headless rendering (make-pdf, screenshots, PDF export) fails with no way to override the binary. Mirror the headed path: pass executablePath when GSTACK_CHROMIUM_PATH is set. --- browse/src/browser-manager.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index 2bc1c597d..8783bdd26 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -377,6 +377,10 @@ export class BrowserManager { // on Linux root/CI/container, where the sandbox requires unprivileged user // namespaces that aren't available. chromiumSandbox: shouldEnableChromiumSandbox(), + // Honor GSTACK_CHROMIUM_PATH here too. The bundled Playwright + // chrome-headless-shell can't load shared libs on NixOS; pointing at a + // system Chromium fixes headless rendering (e.g. make-pdf). + ...(process.env.GSTACK_CHROMIUM_PATH ? { executablePath: process.env.GSTACK_CHROMIUM_PATH } : {}), ...(launchArgs.length > 0 ? { args: launchArgs } : {}), ...(this.proxyConfig ? { proxy: this.proxyConfig } : {}), });