← Commit history

Harden install verification: require screenshot+read at every checkpoint (Developer mode ON, extensions list shows the card Enabled with NO Errors button) - control state is only a hint

John Lauer ·2c4a91433d · ·parent 575c9de
1 file changed +36−12
skills/installing-the-extension/SKILL.md+36−12
@@ -26,6 +26,19 @@ getting "Load unpacked" to pick the right folder; everything else is determinist 2. **The native-messaging host is registered** (`install/install.ps1`, or its steps): host manifest written with `allowed_origins` = the pinned ID, and `HKCU\...\NativeMessagingHosts\inc.adom.native_browser` pointing at it (Chrome and/or Edge). No UAC. 3. **The bridge is installed** in AD's cache (`bridge_install`, once). See the install-flow doc. +## ⭐ Verify by SCREENSHOT, not by control state (the rule for the whole flow)+`desktop_find_control` / UIA state is a fast **hint** and it lies often enough to burn you: a toggle can+read ambiguously, the folder picker can select the wrong directory silently, and **Load unpacked can+"succeed" with a broken manifest** (the card shows a red **Errors** button) - none of which a+`find_control` "is it there?" check catches. So at **every** checkpoint below, take a real screenshot+and **actually read it** before you believe the step worked:+```+desktop_screenshot_window {hwnd:<W>}     # WGC, BACKGROUND - works on the privileged chrome:// page that+                                         # the extension's own CDP cannot shoot (and it isn't loaded yet)+```+Then look at the image: is Developer mode visibly ON? did the picker show the right path? is the Adom+card in the list, **Enabled, with NO Errors button**? Do not assert success off control state alone.+ ## The flow (background; never foreground the user's work) Open a fresh background window you own, get its `hwnd`, and drive **that** (never the user's tabs): ```@@ -34,16 +47,17 @@ desktop_navigate {hwnd:<W>, url:"chrome://extensions"}             # edge://exte desktop_screenshot_window {hwnd:<W>}                               # verify the page loaded (posted Enter is app-specific) ``` -### Step A - ensure Developer mode is ON (don't assume)-The page's **Developer mode** is a toggle (top-right on Chrome, bottom-left on Edge). Read its state,-flip it only if off:+### Step A - ensure Developer mode is ON (verify it VISUALLY)+The page's **Developer mode** is a toggle (top-right on Chrome, bottom-left on Edge). ```-desktop_find_control {hwnd:<W>, contains:"Developer mode"}         # returns the toggle + its toggle state-# if it reports off/unchecked:-desktop_ui_click {hwnd:<W>, contains:"Developer mode"}             # background Invoke -> the Load unpacked / Pack / Update row appears+desktop_find_control {hwnd:<W>, contains:"Developer mode"}         # fast hint: the toggle + claimed state+desktop_screenshot_window {hwnd:<W>}                               # GROUND TRUTH - read it: is the toggle ON?+# only if the SCREENSHOT shows it off:+desktop_ui_click {hwnd:<W>, contains:"Developer mode"}             # background Invoke+desktop_screenshot_window {hwnd:<W>}                               # confirm it flipped AND the Load unpacked / Pack / Update row appeared ```-Verify the **Load unpacked** button is now present (`find_control {hwnd:<W>, contains:"Load unpacked"}`).-If it isn't, Developer mode didn't flip - re-read and retry, don't proceed blind.+Do not proceed until the screenshot shows Developer mode ON and the **Load unpacked** button visible. If+the row didn't appear, the toggle didn't flip - re-read and retry, don't proceed blind.  ### Step B - Load unpacked -> the native folder picker (THE fragile step we harden) ```@@ -64,10 +78,20 @@ Now select the `extension/` folder. This is the step that breaks most often, so > path and confirms, with retries + a screenshot check). Treat the path-fill as "verify, don't assume", > and prefer the helper script once it lands. -### Step C - verify it actually loaded AND connected (two separate checks)-1. **Card present:** `desktop_find_control {hwnd:<W>, contains:"Adom"}` - the extension card shows on-   the page. (Optional: read the card's ID and confirm it equals the pinned ID.)-2. **Connected to the bridge:** poll `nbrowser_status` / `nbrowser_profiles` - the `chrome:`/`edge:`+### Step C - verify it loaded clean AND connected (screenshot FIRST, three checks)+1. **Screenshot the extensions list and READ it** - this is the check that actually matters:+   ```+   desktop_screenshot_window {hwnd:<W>}     # then look at the image+   ```+   Confirm in the image: (a) the **Adom** card is present, (b) it is **Enabled** (toggle on), and (c) it+   shows **NO red "Errors" button**. ⛔ If an **Errors** button is present, the extension loaded+   **broken** (bad manifest / SW threw) - it is NOT installed successfully even though the card exists.+   Open it (`desktop_ui_click {hwnd:<W>, contains:"Errors"}`), screenshot, read the actual error, fix+   it, and reload. A card-present-with-errors is the most common false "success" - the screenshot is the+   only thing that catches it.+2. **Card present (fast secondary):** `desktop_find_control {hwnd:<W>, contains:"Adom"}`. Optional: read+   the card's ID and confirm it equals the pinned ID.+3. **Connected to the bridge:** poll `nbrowser_status` / `nbrowser_profiles` - the `chrome:`/`edge:`    key appears (and the popup shows "connected") within ~1-3s once the SW starts. A loaded-but-not-    connected extension usually means the profile has no open window (SW asleep) or the host manifest /    HKCU registration is missing or has the wrong ID - check the preconditions.