← Commit history

Taskbar favicon overlay fix (John: icons still wrong). ROOT CAUSE: the badge compositor decided ICO-vs-image by the favicon URL ending in .ico, but analyzeIconBytes had already re-encoded it to PNG, so icoLargestPng ran on PNG bytes, returned null, and dropped the favicon -> bare Adom mark (hit Google Docs and any .ico-suffixed favicon). Now sniffs the real magic bytes. SECOND bug: the generic-glyph fallback set src but never populated iconPng (which is the only thing the composite draws), so undecodable favicons also went mark-only; now it renders the glyph into iconPng and marks src.href generic so the LED shows amber, not a lying green.

John Lauer ·80077ee856 ·3mo ago ·parent e68eb14
4 files changed +31−16
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.325",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.325/adom-bridge-puppeteer-v1.9.325.zip",-  "sha256": "c32e248aa71aedfef68e10df11607338178d38ced39062e27689f423fe0e4e00",-  "size": 621510,+  "version": "1.9.326",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.326/adom-bridge-puppeteer-v1.9.326.zip",+  "sha256": "fcea9f2a447d0704af560167d24320d44ba3d77d2875ec333895cc4d7d535f94",+  "size": 621971,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.325+1.9.326
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.325",+  "version": "1.9.326",   "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. macOS (v1.9.74+): full parity with mac-native mechanics \u2014 background-by-default is the app-level hide (windows stay drivable/screenshottable while hidden), raise/lower map to unhide+activate/hide, browser_alert_window posts a native toast whose click focuses the window, browser_use {browser:'chrome',install:true} installs Chrome from the official dmg, and taskbar identity/badging remains Windows-only.",   "homepage": "https://wiki.adom.inc/adom/adom-desktop",   "author": "Adom Inc.",
src/server.js+25−10
@@ -4529,16 +4529,24 @@ async function applyAppOverlay(session, sessionId) {           // .ico can't be decoded by sharp — when we NEED the green plate, fall back to drawing           // the plate alone rather than losing the signal entirely.           let iconPng = null;-          // v1.9.203: an .ico source now yields a real favicon layer via the extractor above.-          if (isIco) {+          // v1.9.326 (John: "your icons are STILL wrong in the taskbar"). ROOT CAUSE of the bare Adom+          // mark on Google Docs (and any site whose favicon URL ends in .ico): decide the container by+          // the actual BYTES, not by the href. analyzeIconBytes has ALREADY re-encoded a resolved+          // favicon to PNG, so a source whose URL merely ends in ".ico" (docs-favicon-2026-v2.ico)+          // arrives here as PNG — the old href-based isIco ran icoLargestPng on PNG bytes, got null,+          // dropped the favicon, and left the mark alone. Sniff the real magic bytes instead.+          {+            const _buf = Buffer.from(src.b64, 'base64');+            const _isIcoBytes = _buf.length >= 4 && _buf[0] === 0 && _buf[1] === 0 && _buf[2] === 1 && _buf[3] === 0;             try {-              const inner = icoLargestPng(Buffer.from(src.b64, 'base64'));-              if (inner) iconPng = await sharpMod(inner).resize(48, 48, { fit: 'cover' }).png().toBuffer();+              if (_isIcoBytes) {+                const inner = icoLargestPng(_buf);+                if (inner) iconPng = await sharpMod(inner).resize(48, 48, { fit: 'cover' }).png().toBuffer();+              } else {+                iconPng = await sharpMod(_buf).resize(48, 48, { fit: 'cover' }).png().toBuffer();+              }             } catch (e) { iconPng = null; }           }-          if (!iconPng && !isIco) {-            try { iconPng = await sharpMod(Buffer.from(src.b64, 'base64')).resize(48, 48, { fit: 'cover' }).png().toBuffer(); } catch (e) { iconPng = null; }-          }           // v1.9.207 — THE ACTUAL HOLE behind John's bare first button, found by tracing the decode           // path instead of guessing at pixels again. The glyph fallback added in 1.9.205 only covers           // "no favicon FOUND at all". But when a favicon IS found and sharp cannot DECODE it (a@@ -4580,9 +4588,16 @@ async function applyAppOverlay(session, sessionId) {                   + '<ellipse cx="24" cy="24" rx="5.6" ry="13" fill="none" stroke="#5f6368" stroke-width="2.6"/>'                   + '<path d="M11.4 24 H36.6" stroke="#5f6368" stroke-width="2.6"/>'                   + '<path d="M13.6 16.4 H34.4 M13.6 31.6 H34.4" stroke="#5f6368" stroke-width="2"/></svg>';-              src = { b64: Buffer.from(svg).toString('base64'), mime: 'image/svg+xml', href: isPdf ? 'generic:pdf' : 'generic:page' };-              session._overlayFav = { kind: isPdf ? 'generic-pdf' : 'generic-web', format: 'svg', mode: 'default', transparent: false, via: 'generated (favicon fetch failed / none declared)', href: src.href, candidates: 0 };-              console.log(`[overlay] "${sessionId}" no favicon — using the generic ${isPdf ? 'PDF' : 'webpage'} icon (Chrome-style) + Adom mark`);+              // v1.9.326: render the glyph straight INTO iconPng. The composite below only draws+              // iconPng, so the old code (which set `src` and left iconPng null) fell through to a+              // mark-only badge — exactly the "no main overlay icon" John kept reporting. sharp+              // rasterises SVG in this build (the wiki's purple badge is an SVG favicon).+              iconPng = await sharpMod(Buffer.from(svg)).resize(48, 48, { fit: 'cover' }).png().toBuffer();+              // Mark the source generic so _overlayIsGeneric (derived from src.href) is honest and the+              // dashboard LED shows AMBER, not a lying green, when we fell back to the glyph.+              src.href = isPdf ? 'generic:pdf' : 'generic:page';+              session._overlayFav = { kind: isPdf ? 'generic-pdf' : 'generic-web', format: 'svg', mode: 'default', transparent: false, via: 'generated (favicon undecodable / none declared)', href: isPdf ? 'generic:pdf' : 'generic:page', candidates: 0 };+              console.log(`[overlay] "${sessionId}" favicon undecodable/absent — generic ${isPdf ? 'PDF' : 'webpage'} icon (Chrome-style) + Adom mark`);             } catch (e) {               console.log(`[overlay] "${sessionId}" generic icon build FAILED: ${e.message}`);               session._appOverlay = false;