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
pup_login and autofill now drive login forms with REAL keystrokes (page.keyboard) instead of a programmatic .value set. React-controlled masked password fields (Gusto and many SSO/Keycloak themes) silently ignore a .value set, the value shows in the DOM but the form submits empty because the framework state never updated, which is why pup could find and fill Gustos field yet never authenticate. fillLoginForm now tags the located username and password fields, focuses each, clears with a real select-all plus backspace, types with genuine key events, VERIFIES the value actually landed and retries once if a React re-render ate the first attempt, then submits. This makes pup drive real-world masked logins natively
4 files changed
+52−32
adom-bridge-puppeteer-manifest.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "puppeteer",- "version": "2.0.123",- "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.123/adom-bridge-puppeteer-v2.0.123.zip",- "sha256": "09f8413a15b1db26a7f4dafa9986c1b13e662f48a3f9915113c7237331e1d0a1",- "size": 865437,+ "version": "2.0.124",+ "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.124/adom-bridge-puppeteer-v2.0.124.zip",+ "sha256": "477443e4b9b56ee3c3559c8564db6392382ba04d57a15edba4ce312b275d58e0",+ "size": 865740, "verbPrefixes": [ "browser_", "desktop_recorder_",
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-2.0.123+2.0.124
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "puppeteer", "displayName": "Puppeteer (Chrome for Testing + Native)",- "version": "2.0.123",+ "version": "2.0.124", "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/credential_vault.js+46−26@@ -277,18 +277,16 @@ async function applyCredentialsToPage(page, url) { // submitted, usernameValue } and NEVER returns the password. async function fillLoginForm(page, { username, password, submit = false } = {}) { if (!password) return { ok: false, reason: 'no_password_supplied' };- const result = await page.evaluate((USERNAME, PASSWORD, SUBMIT) => {+ // Step 1: locate the fields IN-PAGE and TAG them so the Node side can drive them with real+ // keystrokes. (v2.0.123) a password field is not always type=password — Gusto and many+ // SSO/Keycloak themes use type=text + autocomplete="current-password" and mask it themselves.+ const located = await page.evaluate(() => { const isVisible = (el) => !!el && !el.disabled && el.offsetParent !== null && el.getClientRects().length > 0;- // v2.0.123: a password field is not always type=password. Modern/custom login UIs (Gusto,- // many SSO/Keycloak themes) use type=text with autocomplete="current-password" (or name- // "password") and mask it themselves. Match those too, or pup fills nothing on such forms. const isPwd = (el) => el && el.tagName === 'INPUT' && (el.type === 'password' || el.autocomplete === 'current-password' || el.autocomplete === 'new-password' || /(^|[^a-z])password([^a-z]|$)/i.test(el.name || '') || /(^|[^a-z])password([^a-z]|$)/i.test(el.id || '')); const pwd = [...document.querySelectorAll('input')].filter(isVisible).find(isPwd); if (!pwd) return { ok: false, reason: 'no_password_field' };- // Username: prefer autocomplete=username, then email, else the last visible text-ish input- // BEFORE the password in DOM order — but NEVER the password field itself (it may be type=text). const allInputs = [...document.querySelectorAll('input')]; const pi = allInputs.indexOf(pwd); let user = [...document.querySelectorAll('input[autocomplete="username"], input[type="email"]')].find((e) => isVisible(e) && !isPwd(e));@@ -296,26 +294,48 @@ async function fillLoginForm(page, { username, password, submit = false } = {}) const cands = [...document.querySelectorAll('input[type="text"], input[type="tel"], input:not([type])')].filter((e) => isVisible(e) && !isPwd(e)); user = [...cands].reverse().find((c) => allInputs.indexOf(c) < pi) || cands[0] || null; }- const setVal = (el, val) => {- const proto = el instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype;- const setter = Object.getOwnPropertyDescriptor(proto, 'value').set;- try { el.focus(); } catch (e) {}- setter.call(el, val);- el.dispatchEvent(new Event('input', { bubbles: true }));- el.dispatchEvent(new Event('change', { bubbles: true }));- };- if (user && USERNAME) setVal(user, USERNAME);- setVal(pwd, PASSWORD);- let submitted = false;- if (SUBMIT) {- const form = pwd.form;- const btn = form && [...form.querySelectorAll('button[type="submit"], input[type="submit"], button')].find(isVisible);- if (btn) { btn.click(); submitted = true; }- else if (form) { (form.requestSubmit ? form.requestSubmit() : form.submit()); submitted = true; }- }- return { ok: true, filledUsername: !!(user && USERNAME), filledPassword: true, submitted, usernameValue: user ? user.value : null };- }, username || '', password, !!submit);- return result;+ pwd.setAttribute('data-pup-pf', '1');+ if (user) user.setAttribute('data-pup-uf', '1');+ return { ok: true, hasUser: !!user };+ });+ if (!located.ok) return located;++ // Step 2: type with REAL keystrokes (page.keyboard), not a .value-set. v2.0.124 — React-+ // controlled masked inputs (Gusto's #password is one) IGNORE a programmatic .value: it shows in+ // the DOM but submits empty because the framework's own state never updated. Only genuine key+ // events register. Clear-then-type, verify the value actually landed, retry once if it didn't.+ const typeReal = async (sel, text) => {+ try {+ await page.focus(sel);+ await page.keyboard.down('Control'); await page.keyboard.press('KeyA'); await page.keyboard.up('Control');+ await page.keyboard.press('Backspace');+ await page.type(sel, text, { delay: 12 });+ return true;+ } catch (e) { return false; }+ };+ const valLen = async (sel) => { try { return await page.$eval(sel, (el) => (el.value || '').length); } catch (e) { return 0; } };++ let filledUsername = false;+ if (located.hasUser && username) filledUsername = await typeReal('[data-pup-uf]', username);++ await typeReal('[data-pup-pf]', password);+ if ((await valLen('[data-pup-pf]')) === 0) await typeReal('[data-pup-pf]', password); // one retry — first type can lose to a React re-render+ const filledPassword = (await valLen('[data-pup-pf]')) > 0;++ // Step 3: submit (find the button via the tagged field), clean the tags, click.+ const submitted = await page.evaluate((SUBMIT) => {+ const isVisible = (el) => !!el && !el.disabled && el.offsetParent !== null && el.getClientRects().length > 0;+ const pwd = document.querySelector('[data-pup-pf]');+ const form = pwd && pwd.form;+ const btn = SUBMIT ? ((form ? [...form.querySelectorAll('button[type="submit"], input[type="submit"], button')] : [...document.querySelectorAll('button, input[type="submit"]')]).find(isVisible)) : null;+ document.querySelectorAll('[data-pup-pf],[data-pup-uf]').forEach((e) => { e.removeAttribute('data-pup-pf'); e.removeAttribute('data-pup-uf'); });+ if (!SUBMIT) return false;+ if (btn) { btn.click(); return true; }+ if (form) { (form.requestSubmit ? form.requestSubmit() : form.submit()); return true; }+ return false;+ }, !!submit);++ return { ok: true, filledUsername, filledPassword, submitted }; } // Pull a stored cred for the page's URL and fill its login form in the