Open bug report

macOS: nb windows open in front of the user's work (background-by-default isn't enforced on Mac)

Drew Owens · 28d ago

@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_app stays the user's app (Adom Hydrogen) before and after nbrowser_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_window accepts state: "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_for and navigate all 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

  1. 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_violation events, auto-revert) using desktop_frontmost_app plus window order.
  2. Accept state: "minimized" in nbrowser_open_window, so careful callers can open out of sight in one step.
  3. 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).

3 Replies

John Lauer · 27d ago

Noted, and your third ask is mine to fix regardless of who does the macOS work: the skills say background-by-default is enforced in code, without saying that the enforcement is Windows-only. On a Mac that reads as a promise nb does not keep, so an AI following the skills covers the user's screen. I will scope that claim and tell Mac callers to minimize right after opening.

The other two asks, enforcing background on macOS and accepting state: "minimized" in nbrowser_open_window, sit with Kyle along with #51. I have sent him both issues on chat. Note the second one also touches the extension, which is shared, so it needs one owner rather than two.

Sorry about the interruption while you were working. "Stop stealing my screen's foreground" is exactly the complaint this design is meant to prevent.

John Lauer · 27d ago

Ask 2 and ask 3 are done in nb 0.16.39 with extension 0.2.17 (insiders). Ask 1, enforcing background on macOS, stays with Kyle: it needs a Mac to write and to prove.

Ask 2, open out of sight in one step. nbrowser_open_window now accepts state: "minimized". The window opens minimized and stays fully drivable: the battery opens one, reads back state: "minimized", evaluates in it and closes it, on every run.

Worth knowing, since your workaround does the same thing: Chrome ignored state: "minimized" at create time on Windows, so the window came up normal. The extension now minimizes again right after the window exists, which always holds. If you see the same on macOS with your own windows.create, that is why.

Ask 3, the skills. Shipped before this: native-browser-safety and driving-the-extension now scope the "enforced in code" claim to Windows, state plainly that on macOS the window is drawn over the user's work even though focus is not taken, and tell Mac callers to open small and minimize immediately.

Leaving this open for ask 1.

John Lauer · 20d ago

Status for this one: asks 2 and 3 are shipped and now covered by the battery (90/90 on two Windows boxes, nb 0.16.42 + extension 0.2.20). state:"minimized" opens out of sight and the window stays drivable; the skills no longer claim enforcement that macOS does not have.

Ask 1, enforcing background-by-default on macOS, is still not done and still needs a Mac. I have sent Kyle the details three times; if he does not pick it up, say so here and I will write it blind from your measurements and have you verify, which is how the rest of the macOS work in #51 happened.

Log in to reply.