← Commit history

Dashboard finally renders: pup was breaking its own page. The dashboard declared a global named dollar-sign for its query helper, but pup INJECTS window.dollar-sign (its deep shadow-DOM helper) into every page it drives, and a const colliding with an existing global is a parse-time SyntaxError that kills the entire script. The page therefore rendered its static shell and nothing else, while the SSE stream was healthy the whole time (verified by curling the endpoint from the desktop and getting live window data immediately). Renamed the helper to avoid the collision. Also added a pre-ship check that extracts the dashboard script out of the template literal and parses it, because node --check validates only the outer file and cannot see inside a template string, which is why several ships passed their syntax check while serving a dead page.

John Lauer ·b3726deff1 ·3mo ago ·parent ad18257
4 files changed +23−19
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "1.9.229",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.229/adom-bridge-puppeteer-v1.9.229.zip",-  "sha256": "2dd79712e79ae344f34c19034bf4c66f3327fc52f527308971427af0abc27527",-  "size": 454929,+  "version": "1.9.230",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.9.230/adom-bridge-puppeteer-v1.9.230.zip",+  "sha256": "6db6d55ac23aec003ccf3cfa7f78370d25993a291c07127eb38b13f4f783a459",+  "size": 455125,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.9.229+1.9.230
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "1.9.229",+  "version": "1.9.230",   "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+17−13
@@ -7918,21 +7918,25 @@ footer{color:#5c6c7a;font-size:11px;padding:6px 18px 22px} <main id="m"><div class="empty">connecting…</div></main> <footer id="ft"></footer> <script>-const $=s=>document.querySelector(s); let SNAP=null;+// v1.9.230: do NOT declare a global named $ here. pup injects window.$ (its $deep shadow-DOM helper)+// into EVERY page, and a const named $ colliding with that existing global is a parse-time+// SyntaxError that kills this entire script: the page rendered its static shell and nothing else,+// while the SSE stream was fine all along. pup was breaking its own dashboard. Renamed to avoid it.+const _q=s=>document.querySelector(s); let SNAP=null; const ago=ms=>{if(ms==null)return'—';const s=Math.round(ms/1000);if(s<60)return s+'s';const m=Math.round(s/60);if(m<60)return m+'m';const h=Math.floor(m/60);return h+'h '+(m%60)+'m';}; const esc=t=>String(t==null?'':t).replace(/[&<>"]/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;'}[c])); function render(){   if(!SNAP)return; const d=SNAP;-  $('#cW').textContent=d.counts.windows; $('#cT').textContent=d.counts.tabs;-  $('#cB').textContent=d.counts.browsers; $('#cV').textContent=d.bridge.version;-  $('#cM').style.display=d.bridge.minimalTouch?'':'none';-  $('#age').textContent='updated '+new Date(d.ts).toLocaleTimeString();-  const sel=$('#f'), cur=sel.value;+  _q('#cW').textContent=d.counts.windows; _q('#cT').textContent=d.counts.tabs;+  _q('#cB').textContent=d.counts.browsers; _q('#cV').textContent=d.bridge.version;+  _q('#cM').style.display=d.bridge.minimalTouch?'':'none';+  _q('#age').textContent='updated '+new Date(d.ts).toLocaleTimeString();+  const sel=_q('#f'), cur=sel.value;   if(sel.options.length-1!==d.threads.length){     sel.innerHTML='<option value="">all AI threads</option>'+d.threads.map(t=>'<option>'+esc(t)+'</option>').join('');     sel.value=cur;   }-  const q=$('#q').value.toLowerCase(), th=sel.value;+  const q=_q('#q').value.toLowerCase(), th=sel.value;   const rows=d.windows.filter(w=>{     if(th&&(w.owner||w.ownerThread)!==th)return false;     if(q){const hay=(w.sessionId+' '+(w.url||'')+' '+(w.owner||'')+' '+w.tabs.map(t=>t.url||'').join(' ')).toLowerCase();if(!hay.includes(q))return false;}@@ -7940,7 +7944,7 @@ function render(){   // v1.9.225 — render the HIERARCHY: taskbar button -> window(s) -> tabs.   const byId=Object.fromEntries(rows.map(w=>[w.sessionId,w]));   const groups=(d.taskbarButtons||[]).map(b=>({...b,wins:b.windows.map(s=>byId[s]).filter(Boolean)})).filter(g=>g.wins.length);-  $('#m').innerHTML = groups.length? groups.map(g=>+  _q('#m').innerHTML = groups.length? groups.map(g=>     '<div class="tbgroup">'     +'<div class="tbhead"><img class="tbicon" src="/dashboard/badge?session='+encodeURIComponent(g.wins[0].sessionId)+'&t='+d.ts+'" onerror="this.style.visibility=\'hidden\'">'       +'<span class="tblabel">'+esc(g.label)+'</span>'@@ -7988,7 +7992,7 @@ function render(){         +'<button class="btn xs" data-act="close-tab" data-sid="'+esc(w.sessionId)+'" data-tid="'+esc(t.tabId)+'">×</button>'         +'</div>').join('')+'</div>'     +'</div>';}).join('')+'</div>').join('') : '<div class="empty">no pup windows open'+(th||q?' matching this filter':'')+'</div>';-  $('#ft').textContent='bridge up '+ago(d.bridge.uptimeMs)+' · '+d.bridge.platform+' · deps '+(d.bridge.depsOk?'ok':'MISSING')+' · profiles: '+Object.entries(d.profiles).map(([k,v])=>k+'('+v+')').join(', ');+  _q('#ft').textContent='bridge up '+ago(d.bridge.uptimeMs)+' · '+d.bridge.platform+' · deps '+(d.bridge.depsOk?'ok':'MISSING')+' · profiles: '+Object.entries(d.profiles).map(([k,v])=>k+'('+v+')').join(', '); } async function act(p){try{await fetch('/dashboard/action',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(p)});}catch(e){}} // v1.9.227: ONE delegated listener. The previous build inlined onclick handlers inside the page's@@ -8006,12 +8010,12 @@ document.addEventListener('click', ev => {   }   act({ action: a, sessionId: b.dataset.sid, tabId: b.dataset.tid }); });-$('#f').onchange=render; $('#q').oninput=render;+_q('#f').onchange=render; _q('#q').oninput=render; const es=new EventSource('/dashboard/events'); es.onmessage=e=>{const d=JSON.parse(e.data);-  if(d.error){$('#m').innerHTML='<div class="empty">snapshot error: '+esc(d.error)+'</div>';$('#live').classList.add('stale');return;}-  SNAP=d;$('#live').classList.remove('stale');render();};-es.onerror=()=>$('#live').classList.add('stale');+  if(d.error){_q('#m').innerHTML='<div class="empty">snapshot error: '+esc(d.error)+'</div>';_q('#live').classList.add('stale');return;}+  SNAP=d;_q('#live').classList.remove('stale');render();};+es.onerror=()=>_q('#live').classList.add('stale'); </script></body></html>`;  const server = http.createServer(async (req, res) => {