← Commit history

Overlay badges never settle on the generic globe when a real favicon is known: the last-real-favicon reuse keys on the site origin instead of the exact URL, and a painted generic schedules one thirty-second re-resolve so post-churn windows recover their real badge on their own.

John Lauer ·bde4a49920 ·2mo ago ·parent bc7a419
4 files changed +20−7
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.198",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.198/adom-bridge-puppeteer-v2.0.198.zip",-  "sha256": "5ead2e1573555dbf747b3b0927d7941ab8a222390995cd5088e15b5dc1a640f2",-  "size": 926534,+  "version": "2.0.199",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.199/adom-bridge-puppeteer-v2.0.199.zip",+  "sha256": "0d2eba90a4df64fd9b9d2fac78e6e0e5f13f132263a80675dae58559c1939d16",+  "size": 926883,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.198+2.0.199
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.198",+  "version": "2.0.199",   "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. pup_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. pup_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, pup_alert_window posts a native toast whose click focuses the window, pup_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-bridge",   "author": "Adom Inc.",
src/server.js+14−1
@@ -5940,7 +5940,12 @@ async function applyAppOverlay(session, sessionId) {       // to a truly faviconless page still correctly falls through to the generic glyph below.       if ((!src || !src.b64) && session._lastRealSrc && session._lastRealSrc.b64) {         let _curUrl = ''; try { _curUrl = (activePage && activePage.url()) || ''; } catch (e) {}-        if (_curUrl && session._lastRealSrc.forUrl === _curUrl) {+        // v2.0.199 (John's syr-renta/fusio-bri generic globes): key the reuse to the ORIGIN, not the+        // exact URL — same-site navigation kept the same favicon but invalidated the cache, so churny+        // sessions downgraded to the globe and STAYED there. Unreadable current URL (busy page) also+        // reuses: a stale real favicon beats a wrong generic every time.+        const _org = (u) => { try { return new URL(u).origin; } catch (e) { return null; } };+        if (session._lastRealSrc.forUrl && (!_curUrl || _org(session._lastRealSrc.forUrl) === _org(_curUrl))) {           src = { b64: session._lastRealSrc.b64, mime: session._lastRealSrc.mime, href: session._lastRealSrc.href };           session._overlayFav = { kind: 'page-favicon', format: 'png', mode: 'default', transparent: null, via: 'reused last real favicon (re-fetch missed this cycle — no downgrade to generic)', href: src.href };           console.log(`[overlay] "${sessionId}" reused last real favicon (${src.href}) instead of the generic globe — same page, favicon just not re-fetchable this cycle`);@@ -5979,6 +5984,14 @@ async function applyAppOverlay(session, sessionId) {           src = { b64: Buffer.from(_svg2).toString('base64'), mime: 'image/svg+xml', href: _isPdf2 ? 'generic:pdf' : 'generic:page' };           session._overlayFav = { kind: _isPdf2 ? 'generic-pdf' : 'generic-web', format: 'svg', mode: 'default', transparent: false, via: 'generated (no favicon existed anywhere in this window)', href: src.href, candidates: 0 };           console.log(`[overlay] "${sessionId}" no favicon in this session — generic ${_isPdf2 ? 'PDF' : 'webpage'} icon + Adom mark`);+          // v2.0.199: generic must not be a terminal state — the page often becomes readable moments+          // later (post-respawn churn). One re-resolve per generic paint, 30s out.+          if (!session._genericRetryTimer) {+            session._genericRetryTimer = setTimeout(() => {+              session._genericRetryTimer = null;+              try { if (sessions.has(sessionId)) { session._appOverlay = false; session._lastPaintSig = null; applyAppOverlay(session, sessionId).catch(() => {}); } } catch (e) {}+            }, 30000);+          }           console.log(`[overlay] "${sessionId}" no favicon anywhere in this window — using the generic glyph so the badge is never bare`);         } catch (e) {           session._appOverlay = false;