From 72233686a3fb5fabc496dc301c85beaf8aec9f0b Mon Sep 17 00:00:00 2001 From: Tianren Dong Date: Mon, 28 Sep 2026 20:19:57 -0400 Subject: Drop the full-screen tab rule for automation targets (#27) 0.15.54 opened Pi's automation target as a tab in the user's window while it was full screen, assuming macOS would merge a new window into it as a hidden window tab. Chrome disables automatic window tabbing (app_controller_mac.mm), so that never happens; the hidden tabs came from the tab-group bug fixed in 0.15.56. Always prefer Pi's own window. --- test-suite/unit/hidden-input.test.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test-suite') diff --git a/test-suite/unit/hidden-input.test.mjs b/test-suite/unit/hidden-input.test.mjs index 4b45a49..874b5e5 100644 --- a/test-suite/unit/hidden-input.test.mjs +++ b/test-suite/unit/hidden-input.test.mjs @@ -111,15 +111,15 @@ test("visible pages, failed probes, and foreground tabs that become visible proc }); // ---- automation target placement ---- -test("automation targets use a background tab, not a new window, while the user's window is full screen", async () => { - const full = worker({ win: { id: 1, state: "fullscreen" } }); - await full.w.createAutomationTarget("s1", undefined); - assert.equal(full.calls.some((c) => c.method === "windows.create"), false); - assert.deepEqual(clone(full.calls.find((c) => c.method === "tabs.create").props), { url: "about:blank", active: false }); - - const normal = worker({ win: { id: 1, state: "maximized" } }); - await normal.w.createAutomationTarget("s2", undefined); - assert.deepEqual(clone(normal.calls.find((c) => c.method === "windows.create").props), { url: "about:blank", focused: false }); +test("automation targets get their own window even while the user's window is full screen", async () => { + // Chrome disables macOS automatic window tabbing, so a new window is never merged into the user's + // full-screen window; putting Pi's tab in the user's window would only lose isolation. + for (const state of ["fullscreen", "maximized"]) { + const h = worker({ win: { id: 1, state } }); + await h.w.createAutomationTarget(`s-${state}`, undefined); + assert.deepEqual(clone(h.calls.find((c) => c.method === "windows.create").props), { url: "about:blank", focused: false }, state); + assert.equal(h.calls.some((c) => c.method === "tabs.create"), false, state); + } }); // ---- input.debug ---- -- cgit v1.2.3