MCPcopy Index your code
hub / github.com/garrytan/gstack / buildRestartEnv

Function buildRestartEnv

browse/src/cli.ts:265–275  ·  view source on GitHub ↗
(
  globalFlags: GlobalFlags | null | undefined,
  oldState: ServerState | null,
)

Source from the content-addressed store, hash-verified

263 * downgrades a headed session to headless (#1781). Pure + exported for tests.
264 */
265export function buildRestartEnv(
266 globalFlags: GlobalFlags | null | undefined,
267 oldState: ServerState | null,
268): Record<string, string> {
269 const env: Record<string, string> = {};
270 if (globalFlags?.proxyUrl) env.BROWSE_PROXY_URL = globalFlags.proxyUrl;
271 if (globalFlags?.headed || oldState?.mode === 'headed') env.BROWSE_HEADED = '1';
272 const configHash = globalFlags?.configHash || oldState?.configHash;
273 if (configHash) env.BROWSE_CONFIG_HASH = configHash;
274 return env;
275}
276
277/** macOS only: pull the headed Chromium window to the user's current Space.
278 * "Google Chrome for Testing" frequently opens behind the active window or on

Callers 2

sendCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected