app
Pup - the AI's own browser
Public Made by Adomby adom
pup gives your AI a real browser on your desktop that it drives completely, in the background, signed in as you: windows that never jump in front of your work, one shared profile that learns your logins, and every window labeled on the taskbar with its AI thread's name.
← Commit history
1.8.51: no-startup-window kills the focus steal at the source; delete the stability watch and all re-park machinery so user clicks always stick
5 files changed
+60−38
CHANGELOG.md+17@@ -1,5 +1,22 @@ # Changelog — Adom Desktop Puppeteer Bridge +## 1.8.51 — 2026-07-14 — `--no-startup-window`: eliminate the focus steal at the SOURCE (no more war)++John proved a taskbar click within the first couple seconds still got yanked (the 1.8.50 stability+watch cannot tell an early user click from a Chrome self-raise — no watch can). Fix: make the war+impossible instead of fighting it better.++- **Background launches use `--no-startup-window`.** Windows only grants foreground rights to a+ process at launch; with this flag the browser starts with NO window, and when pup creates the+ window via CDP moments later the browser is a background process — the OS itself DENIES it the+ foreground. No steal can happen.+- **Therefore: no stability watch, no timers, no re-parks — deleted.** The park is now: wait for+ the window to exist → hand focus back if somehow taken (normally a no-op) → one SetWindowPos to+ z-bottom → verify → EXIT. A user click at ANY moment — 200ms in or 2 minutes in — has nothing+ running against it.+- Removed the duplicate post-open background re-assert (now only after an explicit sized open,+ where CDP setWindowBounds can re-activate; guarded by a foreground check).+ ## 1.8.50 — 2026-07-14 — One event-driven watchdog replaces the blind-timer park (John: "waiting 1.2s is for the birds") The launch park no longer fires at guessed delays. `osBackgroundWatchdog` = ONE hidden PS process:
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "1.8.50",- "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.50/adom-bridge-puppeteer-v1.8.50.zip",- "sha256": "8c37b03c862439569ef05a4d0e4dbb7d17303a72fc67df93b90bb0f6e9a18424",- "size": 166222,+ "version": "1.8.51",+ "url": "https://wiki.adom.inc/download/adom/adom-desktop-puppeteer-bridge/1.8.51/adom-bridge-puppeteer-v1.8.51.zip",+ "sha256": "0ac560a2ce4f660ab55ee26b9ada08b8a731ef305474f94ec968262cbf318dd5",+ "size": 166663, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-1.8.50+1.8.51
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "1.8.50",+ "version": "1.8.51", "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+37−32@@ -1771,37 +1771,37 @@ async function osBackgroundWatchdog(pid, cdpPort, restoreHwnd) { ' [WinWd]::AttachThreadInput($pupTid, $myTid, $false) | Out-Null', ' }', '}',- // 1. Wait for the window to EXIST (the event, not a guessed delay). Re-resolve the pid- // list every ~500ms (child browser pids can appear late).+ // 1. Wait for the window to EXIST (the event, not a guessed delay). BestWindow (cheap+ // EnumWindows) runs @50ms; the EXPENSIVE pid-list resolution (Get-NetTCPConnection ++ // Get-CimInstance) refreshes only every ~500ms — running it every tick overran the+ // process budget when several windows opened at once (the wiki3-4 'error').+ 'function ResolvePids {',+ ' $l = New-Object System.Collections.ArrayList',+ ' if ($targetPid -ne 0) { [void]$l.Add([int]$targetPid) }',+ ' if ($cdpPort -ne 0) { try { $own = Get-NetTCPConnection -LocalPort $cdpPort -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty OwningProcess; if ($own) { [void]$l.Add([int]$own) } } catch {} }',+ ' $anchors = @($l.ToArray())',+ ' foreach ($tp in $anchors) { Get-CimInstance Win32_Process -Filter "ParentProcessId=$tp" -ErrorAction SilentlyContinue | Where-Object { $_.Name -in @("chrome.exe","msedge.exe") } | ForEach-Object { [void]$l.Add([int]$_.ProcessId) } }',+ ' return ,[int[]]@($l.ToArray())',+ '}', '$pup = [IntPtr]::Zero',+ '$pids = ResolvePids', '$deadline = [Environment]::TickCount + 4000',+ '$nextResolve = [Environment]::TickCount + 500', 'while ([Environment]::TickCount -lt $deadline) {',- ' $pidList = New-Object System.Collections.ArrayList',- ' if ($targetPid -ne 0) { [void]$pidList.Add([int]$targetPid) }',- ' if ($cdpPort -ne 0) { try { $own = Get-NetTCPConnection -LocalPort $cdpPort -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty OwningProcess; if ($own) { [void]$pidList.Add([int]$own) } } catch {} }',- ' $anchors = @($pidList.ToArray())',- ' foreach ($tp in $anchors) { Get-CimInstance Win32_Process -Filter "ParentProcessId=$tp" -ErrorAction SilentlyContinue | Where-Object { $_.Name -in @("chrome.exe","msedge.exe") } | ForEach-Object { [void]$pidList.Add([int]$_.ProcessId) } }',- ' $pup = [WinWd]::BestWindow([int[]]@($pidList.ToArray()))',+ ' $pup = [WinWd]::BestWindow($pids)', ' if ($pup -ne [IntPtr]::Zero) { break }',+ ' if ([Environment]::TickCount -ge $nextResolve) { $pids = ResolvePids; $nextResolve = [Environment]::TickCount + 500 }', ' Start-Sleep -Milliseconds 50', '}', 'if ($pup -eq [IntPtr]::Zero) { Write-Output "no-window"; exit }',- // 2. Deactivate FIRST (while still off-screen), THEN park on-screen at z-bottom.+ // 2. Park ONCE: hand back focus only if Chrome somehow took it (with --no-startup-window+ // the OS denies it the foreground, so this is normally a no-op), then move on-screen+ // at z-bottom. NO stability loop — there is no self-raise to fight anymore, and any+ // watch loop inevitably fights a user's early taskbar click (John proved it: clicking+ // within the first couple of seconds got yanked back). Park, verify, EXIT. 'HandBack $pup', '[WinWd]::SetWindowPos($pup, $BOTTOM, 0, 0, $scrW, $scrH, $SWP) | Out-Null',- // 3. Stability watch: react to Chrome re-grabs within 50ms; exit after 500ms of calm.- '$calmSince = [Environment]::TickCount',- '$watchEnd = [Environment]::TickCount + 2000',- 'while ([Environment]::TickCount -lt $watchEnd) {',- ' $fg = [WinWd]::GetForegroundWindow()',- ' if ($fg -eq $pup) {',- ' HandBack $pup',- ' [WinWd]::SetWindowPos($pup, $BOTTOM, 0, 0, $scrW, $scrH, $SWP) | Out-Null',- ' $calmSince = [Environment]::TickCount',- ' } elseif (([Environment]::TickCount - $calmSince) -ge 500) { break }',- ' Start-Sleep -Milliseconds 50',- '}',- // 4. Self-verify and exit. Nothing runs after this — the user owns the window now.+ // 3. Self-verify and exit. Nothing runs after this — the user owns the window now. '$fg2 = [WinWd]::GetForegroundWindow()', 'if ($fg2 -eq $pup) { Write-Output "still-foreground" } else { Write-Output "backgrounded" }', ].join('\r\n');@@ -2317,11 +2317,18 @@ async function getOrLaunchBrowser(profileName, { freshProfile = false, strictPer // so browser_screenshot/eval/record all work, but the user NEVER sees it pop up and // it never covers their active window. foreground:true launches maximized on-screen // as before. browser_raise_os_window moves it on-screen when the user asks to watch.+ // v1.8.51: `--no-startup-window` is THE fix for the focus-steal war. Windows only grants+ // a process the right to take the foreground at launch. With this flag the browser+ // process starts with NO window at all — the window is created LATER via CDP (newPage),+ // by which time Chrome is a background process and the OS itself DENIES it the+ // foreground. So: no steal is possible, no watchdog/timer war, and a user's taskbar+ // click can never be fought (nothing is running to fight it). The off-screen position+ // args stay as belt-and-suspenders for the brief moment before the park. const chromeArgs = [ ...launchOpts.args.filter(a => a !== '--remote-debugging-port=0' && (foreground || a !== '--start-maximized')), `--remote-debugging-port=${debugPort}`, `--user-data-dir=${userDataDir}`,- ...(foreground ? [] : ['--window-position=-32000,-32000', '--window-size=1280,800']),+ ...(foreground ? [] : ['--no-startup-window', '--window-position=-32000,-32000', '--window-size=1280,800']), ]; console.log(`Chrome launch attempt ${attemptNum} for profile "${profileName}" on CDP port ${debugPort}`); // v1.8.34: snapshot the user's foreground window right before launch (background only)@@ -3484,17 +3491,15 @@ const server = http.createServer(async (req, res) => { // innerWidth/innerHeight deterministic, which is what fullPage/element shots need. try { await session.page.setViewport({ width: Math.round(w), height: Math.round(h), deviceScaleFactor: Number(args.deviceScaleFactor) || 1 }); } catch (e) {} }- // v1.8.26: re-assert background AFTER any sizing (CDP setWindowBounds can- // re-activate the window). Use the real minimize-based backgrounder (drops- // focus), not the old z-order-only one, resolving the window via the browser's- // pid + CDP port.- if (!foreground) {+ // v1.8.51: re-assert background ONLY after an explicit sizing call (CDP+ // setWindowBounds can re-activate the window). For a plain open this re-assert is+ // GONE — it duplicated the launch park and was one more thing that could fight a+ // user's early taskbar click. The respectUser foreground check keeps even the sized+ // path from yanking a window the user has up.+ if (!foreground && sized) { try { const be = browsers.get(args.profile);- // v1.8.44: if the user deliberately raised this window to watch it, don't yank it- // back on a resize either — honor the same latch the open-time retries set.- if (be && be.browser && be.browser._userForeground) { /* user is watching — leave it */ }- else if (be && be.browser) be.browser._bgResult = osBackgroundWindowByPid(be.browser._detachedPid, be.browser._cdpPort, be.browser._priorForeground, true);+ if (be && be.browser) be.browser._bgResult = osBackgroundWindowByPid(be.browser._detachedPid, be.browser._cdpPort, be.browser._priorForeground, true); else osSendWindowToBack(args.profile); } catch (e) {} }