Commit Graph
34 Commits
Author SHA1 Message Date
NoelandClaude Sonnet 4.5 7b43d408da fix: improve error message when element is blocked by overlay (#59)
When clicking an element that is blocked by a cookie banner or modal overlay,
the error message incorrectly showed "Element not found or not visible" even
though the element was found and visible.

The issue was in toAIFriendlyError(): the check for "Timeout" was evaluated
before "intercepts pointer events", causing the wrong error message to be
returned.

Changes:
- Reorder error detection to check "intercepts pointer events" before "Timeout"
- Improve error message to suggest dismissing modals/cookie banners
- Export toAIFriendlyError for testing
- Add focused tests for overlay blocking behavior

Before:
  Element "@e4" not found or not visible. Run 'snapshot' to see current page elements.

After:
  Element "@e4" is blocked by another element (likely a modal or overlay).
  Try dismissing any modals/cookie banners first.

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-13 15:25:46 -06:00
Chris TateandVercel <vercel[bot]@users.noreply.github.com> 2dc093cd62 add screencast (#67)
* docs

* updates

* Fix: The handleCopy function fails to handle errors from navigator.clipboard.writeText(), causing unhandled exceptions and misleading UI feedback when clipboard operations fail.

Co-authored-by: ctate <chris@ctate.dev>

* Fix: The benchmark file uses emojis (📊, 🚀, 🔨, 📈, 📋, , ⏱️, ⚠) in console output, violating repository guidelines that forbid emojis in code and output.

Co-authored-by: ctate <chris@ctate.dev>

* Remove benchmark/run.ts from PR

* screencast

* update docs

* address comments

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-01-13 14:53:27 -06:00
Shirshak 673e2e266e feat: Add extension support (#48)
* Rebase: Add extension support

* Fix logs
2026-01-13 14:34:59 -06:00
Alan JeonClaude Opus 4.5vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
95675e9d55 feat: add CDP connection support for external browsers (#24)
* feat: add CDP connection support for external browsers

Add --cdp flag to connect to browsers via Chrome DevTools Protocol.
This enables control of Electron apps, Chrome instances, or any browser
exposing a CDP endpoint.

- Add cdpPort option to launch command schema
- Implement connectViaCDP() using chromium.connectOverCDP()
- Track browser connection type for proper reconnection handling
- Collect all pages from all contexts for CDP connections

Usage: agent-browser --cdp 9222 snapshot

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: enhance CDP connection handling and improve page tracking

* main.rs update

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* fix: verify CDP connection is alive before early return in launch()

Prevents misleading errors when the remote browser crashes by checking
isConnected() before reusing an existing browser reference.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: reconnect when CDP port changes instead of reusing existing browser

Ensures --cdp flag is respected even when a browser session already exists.
Adds tests for launch() reconnection behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update src/browser.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* fix: improve CDP connection handling and validation

* feat: add CDP connection validation to ensure browser context accessibility

* Update src/browser.ts

Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>

* feat: enhance CDP connection handling and add reconnect logic

* fix: improve CDP connection handling during browser closure

* fix: reset cdpPort to null during browser initialization

* feat: enhance browser launch logic to handle CDP connection switching

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
2026-01-13 00:52:47 -06:00
Chris Tate 1a88d7f585 custom headers via --headers (#30)
* add custom headers via --headers

* add tests

* better parsing
2026-01-12 12:01:19 -06:00
Chris Tate 4f6fd8ec5c support serverless environments (#29)
* add --executable-path

* tests

* test vercel

* fixes
2026-01-12 11:41:25 -06:00
Chris Tate a0802b1863 fix locator issues (#14)
* fix locator issues

* address feedback
2026-01-12 00:29:53 -06:00
Chris Tate 5a7c7440c0 add ci action (#12)
* add ci action

* pre-commit hook

* format
2026-01-12 00:02:38 -06:00
Chris Tate 9f7d7d6447 fix cookies/storage (#10) 2026-01-11 23:27:49 -06:00
Chris Tate 3bd331b97f cleanup 2026-01-11 10:08:08 -06:00
Chris Tate c0ed5c443e remove ts cli 2026-01-11 09:57:41 -06:00
Chris Tate 36b1af29f6 windows 2026-01-11 09:54:51 -06:00
Chris Tate 82079d6d20 update unit tests 2026-01-11 09:48:44 -06:00
Chris Tate 6b3bae760b fixes 2026-01-11 03:23:39 -06:00
Chris Tate 7443a4a4c5 smart snapshots 2026-01-11 02:44:27 -06:00
Chris Tate 34821f001e bun 2026-01-11 02:28:51 -06:00
Chris Tate 71b1c50533 refs 2026-01-11 02:06:17 -06:00
Chris Tate 68115b85ce prevent relaunch 2026-01-11 01:05:25 -06:00
Chris Tate 627c88888e fix console/errors 2026-01-11 00:21:26 -06:00
Chris Tate e7c25e9030 --with-deps 2026-01-10 23:50:09 -06:00
Chris Tate a7e5de5e4f install 2026-01-10 23:47:30 -06:00
Chris Tate 0cd29aa119 agent-browser 2026-01-10 22:51:59 -06:00
Chris Tate 6de8102978 headed 2026-01-10 13:37:52 -06:00
Chris Tate 0638bcdd3c tests 2026-01-10 13:12:38 -06:00
Chris Tate 93374638eb scripts 2026-01-10 13:08:22 -06:00
Chris Tate ff05842fd8 more 2026-01-10 13:06:36 -06:00
Chris Tate 55d40e1dba simple 2026-01-10 12:30:01 -06:00
Chris Tate fd59fc9ab7 more 2026-01-10 12:23:45 -06:00
Chris Tate 10466d7c4c timeout 2026-01-10 12:17:39 -06:00
Chris Tate 6dc408e02f more 2026-01-10 12:15:57 -06:00
Chris Tate b6e1693739 more 2026-01-10 12:03:30 -06:00
Chris Tate 774002a351 more commands 2026-01-10 11:57:58 -06:00
Chris Tate 9d253da8bd session 2026-01-10 11:43:55 -06:00
Chris Tate 2d0520b770 init 2026-01-10 11:33:37 -06:00