diff --git a/.changeset/release-v0231.md b/.changeset/release-v0231.md new file mode 100644 index 0000000..35ef3a6 --- /dev/null +++ b/.changeset/release-v0231.md @@ -0,0 +1,17 @@ +--- +"agent-browser": patch +--- + +### New Features + +- **Auto-dismissal for alert and beforeunload dialogs** - JavaScript `alert()` and `beforeunload` dialogs are now automatically accepted to prevent the agent from blocking indefinitely. `confirm` and `prompt` dialogs still require explicit `dialog accept/dismiss` commands. Disable with `--no-auto-dialog` flag or `AGENT_BROWSER_NO_AUTO_DIALOG` environment variable (#1075) +- **Puppeteer browser cache fallback** - Chrome discovery now searches `~/.cache/puppeteer/chrome/` (or `PUPPETEER_CACHE_DIR`) for Chrome binaries, so users with an existing Puppeteer installation can use agent-browser without a separate install step (#1088) +- **Console output improvements** - `console.log` of objects now shows the actual object preview (e.g. `{userId: "abc", count: 42}`) instead of `"Object"`. JSON output includes a raw `args` array for programmatic access (#1040) + +### Bug Fixes + +- Fixed **same-document navigation** (e.g. SPA hash routing) hanging forever because `wait_for_lifecycle` waited for a `Page.loadEventFired` that never fires on same-document navigations (#1059) +- Fixed **save_state** only capturing cookies and localStorage for the current origin, silently dropping cross-domain data (e.g. SSO/CAS auth cookies). Now uses `Network.getAllCookies` and collects localStorage from all visited origins (#1064) +- Fixed **externally opened tabs** not appearing in `tab list` when using `--cdp` mode. Tabs opened by the user or another CDP client are now detected and tracked (#1042) +- Fixed **dashboard server** not picking up installed files without a restart. `dashboard install` now takes effect immediately on a running server (#1066) +- Fixed **Windows Chrome extraction** failing because zip path normalization used forward slashes while the extraction code expected backslashes (#1088) diff --git a/README.md b/README.md index 9005e39..aa8ce42 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Detects your installation method (npm, Homebrew, or Cargo) and runs the appropri ### Requirements -- **Chrome** - Run `agent-browser install` to download Chrome from [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) (Google's official automation channel). No Playwright or Node.js required for the daemon. +- **Chrome** - Run `agent-browser install` to download Chrome from [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) (Google's official automation channel). Existing Chrome, Brave, Playwright, and Puppeteer installations are detected automatically. No Playwright or Node.js required for the daemon. - **Rust** - Only needed when building from source (see From Source above). ## Quick Start @@ -334,6 +334,7 @@ agent-browser trace stop [path] # Stop and save trace agent-browser profiler start # Start Chrome DevTools profiling agent-browser profiler stop [path] # Stop and save profile (.json) agent-browser console # View console messages (log, error, warn, info) +agent-browser console --json # JSON output with raw CDP args for programmatic access agent-browser console --clear # Clear console agent-browser errors # View page errors (uncaught JavaScript exceptions) agent-browser errors --clear # Clear errors diff --git a/docs/src/app/commands/page.mdx b/docs/src/app/commands/page.mdx index b6ea89e..5f1b4ac 100644 --- a/docs/src/app/commands/page.mdx +++ b/docs/src/app/commands/page.mdx @@ -256,6 +256,7 @@ agent-browser record start # Start video recording (WebM) agent-browser record stop # Stop and save video agent-browser record restart # Stop current and start new recording agent-browser console # View console messages +agent-browser console --json # JSON output with raw CDP args agent-browser console --clear # Clear console log agent-browser errors # View page errors agent-browser errors --clear # Clear error log diff --git a/docs/src/app/engines/chrome/page.mdx b/docs/src/app/engines/chrome/page.mdx index 86b1ec3..d76ec60 100644 --- a/docs/src/app/engines/chrome/page.mdx +++ b/docs/src/app/engines/chrome/page.mdx @@ -17,6 +17,8 @@ When no `--executable-path` is provided, agent-browser searches for Chrome in th /Applications/Google Chrome.app, /Applications/Google Chrome Canary.app, /Applications/Chromium.app, + /Applications/Brave Browser.app, + Puppeteer cache (~/.cache/puppeteer/chrome/ or PUPPETEER_CACHE_DIR), Chrome for Testing cache @@ -27,6 +29,7 @@ When no `--executable-path` is provided, agent-browser searches for Chrome in th google-chrome-stable, chromium-browser, chromium in PATH, + Puppeteer cache (~/.cache/puppeteer/chrome/ or PUPPETEER_CACHE_DIR), Chrome for Testing cache diff --git a/docs/src/app/observe/page.mdx b/docs/src/app/observe/page.mdx index 4285454..41877cd 100644 --- a/docs/src/app/observe/page.mdx +++ b/docs/src/app/observe/page.mdx @@ -111,10 +111,13 @@ Sent when the browser logs to the console: "type": "console", "level": "log", "text": "Page loaded", + "args": [{"type": "string", "value": "Page loaded"}], "timestamp": 1711367000100 } ``` +The `args` array contains the raw CDP `Runtime.consoleAPICalled` arguments for programmatic access. Object arguments include preview data (e.g. `{userId: "abc", count: 42}` instead of `"Object"`). + These are in addition to the existing `frame`, `status`, and `error` message types documented on the [Streaming](/streaming) page. ## Architecture diff --git a/package.json b/package.json index 814f7a9..9bdbf4b 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "bugs": { "url": "https://github.com/vercel-labs/agent-browser/issues" }, - "homepage": "https://github.com/vercel-labs/agent-browser#readme", + "homepage": "https://agent-browser.dev", "devDependencies": { "@changesets/cli": "^2.29.8" } diff --git a/skills/agent-browser/SKILL.md b/skills/agent-browser/SKILL.md index 00f97aa..cd5100a 100644 --- a/skills/agent-browser/SKILL.md +++ b/skills/agent-browser/SKILL.md @@ -6,7 +6,7 @@ allowed-tools: Bash(npx agent-browser:*), Bash(agent-browser:*) # Browser Automation with agent-browser -The CLI uses Chrome/Chromium via CDP directly. Install via `npm i -g agent-browser`, `brew install agent-browser`, or `cargo install agent-browser`. Run `agent-browser install` to download Chrome. Run `agent-browser upgrade` to update to the latest version. +The CLI uses Chrome/Chromium via CDP directly. Install via `npm i -g agent-browser`, `brew install agent-browser`, or `cargo install agent-browser`. Run `agent-browser install` to download Chrome. Existing Chrome, Brave, Playwright, and Puppeteer installations are detected automatically. Run `agent-browser upgrade` to update to the latest version. ## Core Workflow @@ -187,7 +187,7 @@ agent-browser clipboard paste # Paste from clipboard # Dialogs (alert, confirm, prompt, beforeunload) # By default, alert and beforeunload dialogs are auto-accepted so they never block the agent. # confirm and prompt dialogs still require explicit handling. -# Use --no-auto-dialog to disable automatic handling. +# Use --no-auto-dialog (or AGENT_BROWSER_NO_AUTO_DIALOG=1) to disable automatic handling. agent-browser dialog accept # Accept dialog agent-browser dialog accept "my input" # Accept prompt dialog with text agent-browser dialog dismiss # Dismiss/cancel dialog