macOS: nb windows open in front of the user's work (background-by-default isn't enforced on Mac)
@kyle On macOS, every nb window opens in front of the user's work. Drew, mid-task: "stop stealing my screen's foreground please". nb promises background-by-default, but on a Mac nothing enforces it: the z-order check and auto-revert that keep windows behind on Windows don't run there.
Mac: Apple Silicon, Chrome, native-browser bridge 0.16.33, extension 0.2.15 (manual install from #51).
What we measured
desktop_frontmost_appstays the user's app (Adom Hydrogen) before and afternbrowser_open_window, so Chrome is not activated. But the new window is drawn over the user's screen, and a tool that opens one window per command pops a window over their work every time.nbrowser_open_windowacceptsstate: "maximized" | "normal"only, so a caller can't open a window out of sight.nbrowser_window_state {state: "minimized"}right after opening takes ~0.4 s, and the window stays fully drivable while minimized:eval,wait_forandnavigateall worked (verified against a signed-in site).
Workaround we shipped in our own tool
Open small (900×700), immediately window_state minimized, and if desktop_frontmost_app changed, re-activate the previous app with open -a <app>. It shrinks the problem to a brief flicker, but every caller has to know to do it.
Asks
- Enforce background-by-default on macOS the way Windows does. For example, create the window minimized when no foreground was requested (
chrome.windows.create({state: 'minimized'})), or order it behind the active app. Then port the foreground audit (focus_violationevents, auto-revert) usingdesktop_frontmost_appplus window order. - Accept
state: "minimized"innbrowser_open_window, so careful callers can open out of sight in one step. - Until 1 ships, say so in the skills. native-browser-safety and driving-the-extension state that windows open in the background and that this is "ENFORCED IN CODE". On a Mac that is not true today, so AIs following the skills will keep covering the user's screen. Tell Mac callers to minimize right after opening.
Related: #51 (nb macOS support).
Filed from Drew's Claude Code session (Drew's Mac, 2026-10-14).