Skip to content

feat: implement feature parity with agent-browser (10 issues)#56

Merged
justrach merged 5 commits into
mainfrom
fix/36-fix-action-ref-to-element-resolution-refs-not-inje
Mar 4, 2026
Merged

feat: implement feature parity with agent-browser (10 issues)#56
justrach merged 5 commits into
mainfrom
fix/36-fix-action-ref-to-element-resolution-refs-not-inje

Conversation

@justrach

@justrach justrach commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Feature Parity Implementation

Closes #36, #38, #39, #40, #41, #42, #49, #50, #51

Critical Fix

New Endpoints (9)

Endpoint Issue Description
/back?tab_id= #40 Browser history back
/forward?tab_id= #40 Browser history forward
/reload?tab_id= #40 Page reload via CDP
/diff/snapshot?tab_id= #38 Snapshot diffing (added/removed/changed)
/cookies?tab_id= #41 Get/set cookies via CDP
/cookies/clear?tab_id= #41 Clear all cookies
/storage/local?tab_id= #42 Get/set/list localStorage
/storage/session?tab_id= #42 Get/set/list sessionStorage
/get?tab_id=&type= #50 Query element info (html/value/attr/title/url/count/box/styles)

Enhanced Endpoints

Feature Issue Description
/screenshot?full=true #39 Full-page screenshot
/snapshot?depth=N #51 Depth-limited snapshot
/text?selector= #49 CSS selector scoping

Live-Tested

All 21 endpoints verified against Chrome 145 on macOS.

Co-authored-by: blackfloofie 265516171+blackfloofie@users.noreply.github.com

justrach and others added 4 commits March 4, 2026 15:59
…hot pipeline, crawler, and 20 passing tests

- build.zig + build.zig.zon for Zig 0.15.1
- HTTP server with /health and /tabs endpoints (std.http.Server)
- Bridge with thread-safe tab registry (RwLock)
- CDP client with JSON-RPC message building
- A11y snapshot pipeline: filter, depth, format, diff
- Crawler: URL validator (SSRF protection), rate limiter, HTML→Markdown converter
- Stealth mode: embedded stealth.js + UA rotation
- Storage stubs: local, Kafka, R2
- All 20 unit tests passing

Refs #1
…34)

- Add pure Zig WebSocket client (RFC 6455: handshake, masked frames, large msg alloc)
- Wire CDP client into Bridge with per-tab connections and string ownership
- Add HTTP routes: /discover, /navigate, /snapshot, /action, /text, /screenshot, /evaluate
- Add /browdie easter egg 🧁 (she browses different)
- Fix #30: /discover HTTP/1.1 + Content-Length + SO_RCVTIMEO
- Fix #31: WebSocket localhost -> 127.0.0.1 resolution
- Fix #32: Tab string lifetime (dupe into bridge allocator, fetchRemove old entries)
- Fix #34: CDP response ID correlation (skip events, match by command ID)
- Add test harness for agent-led browser testing (#33)
- Fix embedFile paths, i128->i64 cast, comptimePrint->runtime search
- 49 tests passing, full e2e verified against Chrome + merlionjs.com

Amp-Thread-ID: https://ampcode.com/threads/T-019cb7e2-d40c-7089-949c-dee9ad3ede19
Co-authored-by: Amp <amp@ampcode.com>
- Chrome launcher (launch, health-check, auto-restart, port detection)
- HAR recorder with /har/start, /har/stop, /har/status endpoints
- /close endpoint for tab cleanup with full resource deallocation
- HAR recorder cleanup in removeTab + Bridge.deinit (no memory leaks)
- 99+ tests: integration suite, bridge stress, diff, ref cache, markdown, validator
- Updated readme.md to reflect actual implemented state
- Added CHANGELOG.md and CONTRIBUTORS.md

Closes #20, #16

Refs #20
Fixes #36: Fix /action ref resolution using DOM.resolveNode + Runtime.callFunctionOn
- Parse backendDOMNodeId from CDP a11y tree
- Populate ref cache during /snapshot
- Resolve refs via CDP instead of broken CSS selectors

Fixes #38: Add /diff/snapshot endpoint using existing diff.zig
Fixes #39: Add full-page screenshot (?full=true)
Fixes #40: Add /back, /forward, /reload endpoints
Fixes #41: Add /cookies and /cookies/clear endpoints
Fixes #42: Add /storage/local and /storage/session endpoints
Fixes #49: Add CSS selector scoping for /text
Fixes #50: Add /get endpoint (html/value/attr/title/url/count/box/styles)
Fixes #51: Add depth param for /snapshot

Co-authored-by: blackfloofie <265516171+blackfloofie@users.noreply.github.com>

Refs #36
Co-authored-by: blackfloofie <265516171+blackfloofie@users.noreply.github.com>
@justrach justrach merged commit a0f2712 into main Mar 4, 2026
@justrach justrach deleted the fix/36-fix-action-ref-to-element-resolution-refs-not-inje branch March 4, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix /action ref-to-element resolution (refs not injected into DOM)

1 participant