macOS only: pull the headed Chromium window to the user's current Space. * "Google Chrome for Testing" frequently opens behind the active window or on * another Space — the first thing users read as "I can't see the browser" * (#1781). Best-effort, fire-and-forget, never throws. The app name is a
()
| 280 | * (#1781). Best-effort, fire-and-forget, never throws. The app name is a fixed |
| 281 | * literal (no interpolation). */ |
| 282 | function raiseHeadedWindowMacOS(): void { |
| 283 | if (process.platform !== 'darwin') return; |
| 284 | try { |
| 285 | nodeSpawn('osascript', ['-e', 'tell application "Google Chrome for Testing" to activate'], { |
| 286 | stdio: 'ignore', |
| 287 | detached: true, |
| 288 | }).unref(); |
| 289 | } catch { |
| 290 | // osascript missing or app not present — non-fatal |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | // ─── Server Lifecycle ────────────────────────────────────────── |
| 295 | async function startServer(extraEnv?: Record<string, string>): Promise<ServerState> { |