( globalFlags: GlobalFlags | null | undefined, oldState: ServerState | null, )
| 263 | * downgrades a headed session to headless (#1781). Pure + exported for tests. |
| 264 | */ |
| 265 | export 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 |
no outgoing calls
no test coverage detected