← Commit history

v1.9.40: re-tag adopted window titles so AD can resolve them and windows stop sharing one session suffix

John Lauer ·2eb41a9193 · ·parent b75bcd8
5 files changed +57−6
CHANGELOG.md+18
@@ -1,5 +1,23 @@ # Changelog — Adom Desktop Puppeteer Bridge +## 1.9.40 — 2026-07-20 — Adopted windows are re-tagged, so they stop being invisible and colliding++John dragged a tab out of a 3-category window and got sloppy results: one new window kept the bare+Chrome icon, and a window wore the favicon of an app it had nothing to do with. One root cause+behind both, and it was careless: an ADOPTED tab kept the title of the session it came FROM. All+three windows still read "(session: hybrid)".++Consequences, both observed live: AD could never resolve the new window by "(session: <newId>)", so+brandPupWindow/overlay/jump-list refresh failed outright ("could not refresh taskbar presence") and+the window kept the default Chrome icon; and because several windows answered to the SAME suffix,+any title-based operation hit an arbitrary one, which is how a shotlog favicon landed on a window+that was not shotlog.++Fix: retagSessionTitle() strips any existing pup suffix, installs the new session's suffix, and+re-arms the MutationObserver. It runs on the adopted tab BEFORE any branding (everything downstream+resolves the window by that suffix), and re-asserts the source window's own tag since its tab set+changed underneath it.+ ## 1.9.39 — 2026-07-20 — The dark-teal window grows 30 percent, and the glyph keeps its margin  I had misread the last request: I grew the line drawing INTO the window's margins, which is exactly
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.39",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.39/adom-bridge-puppeteer-v1.9.39.zip",-  "sha256": "02392f10ebc41a1097e26a2c53d687aabd8d712b7846d156768fac1cc6c745a9",-  "size": 289997,+  "version": "1.9.40",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.40/adom-bridge-puppeteer-v1.9.40.zip",+  "sha256": "a5544bbbc53d1d1d65eea07b148afb6239880e99f0312fee05e37690f9e984dd",+  "size": 290611,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.39\ No newline at end of file+1.9.40\ No newline at end of file
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.39",+  "version": "1.9.40",   "description": "Drives a browser ALREADY on the machine \u2014 installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) \u2014 launched with a FRESH isolated profile, so the common case has NO ~150 MB Chrome-for-Testing download and it never touches the user's real tabs/logins. Binds its local server to LOOPBACK (127.0.0.1) only, so no Windows Firewall 'allow Node through the firewall' prompt ever pops. Chrome for Testing is fetched only as a LAST RESORT if the machine has no Chromium browser at all. SPAWN-VERIFIED fallback: pup tries each detected browser (Chrome \u2192 Edge \u2192 CfT) and actually launches it, falling through to the next if one won't start (and handling browsers like Edge that relaunch onto another PID), so a corrupt/partial install never hard-fails an open. The browser that launches is cached as the default (persisted across restarts) so it isn't re-probed each time. On spawn the bridge SELF-WARMS: detects browsers + disk, and only if the box has no Chrome/Edge and no cached CfT does it background-fetch CfT so the first open is instant. browser_use pins a specific browser (chrome | edge | cft | auto); {browser:'chrome',install:true} downloads & installs REAL Google Chrome (user-scoped, no admin) on an Edge-only box. browser_readiness (READ-ONLY) reports which browser will be used + the full candidate list + the default + free disk. Every failure returns a specific errorCode + _hint (chrome_install_no_disk, chrome_download_network, chrome_install_permission, chrome_stable_not_detected, \u2026). Launches with FULL browser permissions by default for full debug (strictPermissions:true opts out). Headful automation: open/close windows+tabs, navigate, screenshot, eval JS, record. pup is a GENERIC, non-profile browser only \u2014 every session is a fresh isolated Chrome/Edge process, never the user's real signed-in browser; profile defaults to sessionId. To drive the user's REAL Chrome/Edge (their profile, cookies, SSO), use the Adom browser EXTENSION's nbrowser_* verbs \u2014 a separate bridge, not pup's job.",   "homepage": "https://wiki.adom.inc/adom/adom-desktop",   "author": "Adom Inc.",
src/server.js+33
@@ -2433,6 +2433,10 @@ async function adoptDraggedOutTabs(sessionId) {       ns._sessionId = newId;       attachTab(ns, newId, t.page);       sessions.set(newId, ns);+      // Re-tag the title FIRST: every downstream operation (identity stamp, overlay, jump list)+      // resolves this window by its "(session: <id>)" suffix, and until it says the NEW id the+      // window is invisible to AD and collides with its old siblings.+      await retagSessionTitle(t.page, newId, ns.profileName);       const be = browsers.get(session.profileName);       if (be) be.refCount++;       let u = null; try { u = t.page.url(); } catch (e) {}@@ -2448,6 +2452,11 @@ async function adoptDraggedOutTabs(sessionId) {       // favicon may belong to the tab that just left. Force a full, retried refresh.       session._lastCat = undefined;   // defeat the same-category short-circuit       _appOverlayCache.delete(sessionId + ':explicit');+      // Re-assert the source window's own tag (its tab set changed under it).+      try {+        const at = (session.tabs || []).find(x => x.tabId === session.activeTabId) || session.tabs[0];+        if (at) await retagSessionTitle(at.page, sessionId, session.profileName);+      } catch (e) {}       refreshWindowChrome(session, sessionId).catch(() => {});     }   } catch (e) { console.log(`[drag] adopt threw: ${e.message}`); }@@ -2474,6 +2483,30 @@ async function drainWindowOpenedEvents() {     for (const [sid] of [...sessions]) { await adoptDraggedOutTabs(sid); }   } catch (e) {} }+// v1.9.40: RE-TAG a page's title suffix to a NEW sessionId. An adopted (dragged-out) tab kept the+// title of the session it came FROM, so AD could never resolve the new window by+// "(session: <newId>)" — its refresh silently failed (bare Chrome icon, stale/none overlay) and,+// worse, several windows all answered to the SAME "(session: hybrid)" string, so title-based+// operations landed on an arbitrary window (that is how a shotlog favicon ended up on a window that+// was not shotlog). Strips ANY existing pup suffix, installs the new one, and re-arms the observer.+async function retagSessionTitle(page, sessionId, profileName) {+  const suffix = profileName && profileName !== sessionId+    ? ` (session: ${sessionId} | profile: ${profileName})`+    : ` (session: ${sessionId})`;+  try {+    await page.evaluate((sfx) => {+      const strip = (t) => String(t || '').replace(/\s*\(session:[^)]*\)\s*$/, '');+      try { if (window.__pupTitleObs) { window.__pupTitleObs.disconnect(); window.__pupTitleObs = null; } } catch (e) {}+      document.title = strip(document.title) + sfx;+      const obs = new MutationObserver(() => {+        try { if (!document.title.endsWith(sfx)) document.title = strip(document.title) + sfx; } catch (e) {}+      });+      obs.observe(document.querySelector('title') || document.head, { childList: true, subtree: true, characterData: true });+      window.__pupTitleObs = obs;+    }, suffix);+    return true;+  } catch (e) { return false; }+} // v1.9.36: refresh EVERYTHING a window's taskbar presence shows (identity icon, favicon overlay, // jump list) and RETRY until the shell can actually see the window. John: "you can't be lazy about // those overlay icons, always make sure they are as up to date as you can get them." A brand-new