← Commit history

HARD RULE: never reuse/navigate a window the user is in (incl. desktop_navigate) — always open a fresh window for captures/driving

John Lauer ·219c89caad ·4mo ago ·parent 6bbd811
2 files changed +14
bridge/server.js+1
@@ -239,6 +239,7 @@ const HELP = {     'Poll nbrowser_events to learn if the USER closed your windows/tabs (window_closed {byUser:true}).',   ],   bestPractices: [+    '⛔ NEVER reuse a window the user already has open. Do not nbrowser_navigate / reload it, and do NOT desktop_navigate it either — that yanks their live page out from under them. For ANY page YOU need (driving, reading, or screenshotting a chrome://extensions / edge://extensions page for a guide), open a NEW window (nbrowser_open_window, or a fresh OS window you then desktop_navigate), work in THAT window, and close it when done. The only thing you may do to one of their existing windows is desktop_bring_to_front to surface it for them.',     'Before driving, nbrowser_status to confirm connected. After a dev_reload, expect a ~3-6s reconnect.',     '⭐ BACKGROUND IS THE WHOLE POINT — NEVER foreground the driven window to screenshot OR record. The user must keep working while a demo records behind their other windows; yanking Chrome forward makes the feature useless. nbrowser_screenshot (CDP) captures a background/occluded window unconditionally. WGC recording captures a background/occluded window TOO — but only when the recorded Chrome was launched with the occlusion-disable flags (see Recording); without them an occluded window paints blank. Foregrounding is the USER\'s choice, made by them when they want to watch — it is never something the AI should do on its own.',     'For demos: nbrowser_caption (in-page subtitle/alert) OR AD desktop_caption (fullscreen; use position:bottom — top covers the URL bar + Chrome warning).',
skills/driving-the-extension/SKILL.md+13
@@ -10,6 +10,19 @@ native-browser counterpart to `pup`. Because it runs **inside the user's actual cookies, SSO, saved logins and human-trust signals all apply, so it sails through login walls and captchas that block pup's empty controlled-Chromium. That is the whole point. +## ⛔ Golden rule: NEVER reuse a window the user is in — always open a fresh one++The user is working in their browser. **Never navigate, reload, or repurpose a window/tab they+already have open** — not with `nbrowser_navigate`, and **not with the OS-level `desktop_navigate`+either.** That yanks their live page out from under them and is rightly seen as hostile. This applies+to **everything you do for your own needs** — driving a workflow, reading a doc, and especially+**grabbing a screenshot** (e.g. of a `chrome://extensions` / `edge://extensions` page for a guide).++The rule, every time: **open a NEW window** (`nbrowser_open_window {url}`, or a fresh OS window you+then `desktop_navigate`), do your work and capture in THAT window, and **close it when done.** The+only thing you may do to one of their existing windows is `desktop_bring_to_front` to surface it for+them — never to drive or navigate it.+ **Path:** `cloud → relay → adom-desktop (laptop) → native-browser bridge → native-messaging host → extension service worker → back`. You call `adom-desktop nbrowser_* '<json>'`.