Skip to content
Open
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
9 changes: 9 additions & 0 deletions browse/src/browser-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ export class BrowserManager {
console.log(`[browse] Extensions loaded from: ${extensionsDir}`);
}

// Support custom Chromium binary via GSTACK_CHROMIUM_PATH (same as launchHeaded).
// Falls back to standard Playwright Chromium when unset or path does not exist.
const headlessCloakPath = process.env.GSTACK_CHROMIUM_PATH;
const headlessCloakExec = headlessCloakPath && require('fs').existsSync(headlessCloakPath)
? headlessCloakPath
: undefined;
if (headlessCloakExec) console.log(`[browse] Using custom Chromium: ${headlessCloakExec}`);

this.browser = await chromium.launch({
headless: useHeadless,
// On Windows, Chromium's sandbox fails when the server is spawned through
Expand All @@ -244,6 +252,7 @@ export class BrowserManager {
chromiumSandbox: process.platform !== 'win32',
...(launchArgs.length > 0 ? { args: launchArgs } : {}),
...(this.proxyConfig ? { proxy: this.proxyConfig } : {}),
...(headlessCloakExec ? { executablePath: headlessCloakExec } : {}),
});

// Chromium crash → exit with clear message
Expand Down