fix(browser): suppressed blank shared startup window

Added Chromium no-startup-window to the broker-owned browser launch so no unowned foreground page survives session tab cleanup.

Covered the resolved Chromium argv and documented the Windows regression.

Fixes #8615
This commit is contained in:
roboomp
2026-08-15 06:49:30 +00:00
parent ffd53ff92a
commit d6dcfed844
3 changed files with 26 additions and 3 deletions
@@ -4,6 +4,7 @@ import * as fs from "node:fs";
import * as path from "node:path";
import {
chromiumExecutableProbeForTest,
resolveSharedBrowserLaunchSpec,
stealthIgnoreDefaultArgsForTest,
systemChromiumCandidatesForTest,
} from "@oh-my-pi/pi-coding-agent/tools/browser/launch";
@@ -44,6 +45,24 @@ describe("browser launch stealth defaults", () => {
});
});
describe("shared browser launch", () => {
it("suppresses the broker-owned blank startup window", async () => {
const previousExecutable = process.env.PUPPETEER_EXECUTABLE_PATH;
process.env.PUPPETEER_EXECUTABLE_PATH = "/test/chrome";
try {
const launch = await resolveSharedBrowserLaunchSpec({
headless: true,
userDataDir: "/test/profile",
});
expect(launch?.args).toContain("--no-startup-window");
} finally {
if (previousExecutable === undefined) delete process.env.PUPPETEER_EXECUTABLE_PATH;
else process.env.PUPPETEER_EXECUTABLE_PATH = previousExecutable;
}
});
});
const UNGOOGLED_CHROMIUM_FLATPAK_ID = "io.github.ungoogled_software.ungoogled_chromium";
describe("system Chromium candidates", () => {