Repository navigation
feat: add network har start/stop command for HAR 1.2 export - #874
Merged
Merged
Conversation
Expose HAR recording as a CLI subcommand under the existing `network` command so users can capture and export network traffic without a separate tool or opening the browser twice. - Parse `network har start` and `network har stop [path]` in commands.rs - Enrich HarEntry with request/response headers, timestamps, status text, resource type, HTTP version, and body sizes from CDP events - Produce HAR 1.2 output with creator/browser metadata, query strings, and proper header arrays compatible with Chrome DevTools HAR viewer - Auto-generate output path under ~/.agent-browser/tmp/har/ when omitted - Add har_stop to skip_launch list so export works without a live browser - Update help text, README, docs site, SKILL.md, and security policy docs - Add unit tests for parsing, HAR entry serialization, and stop behavior
Contributor
|
@ysm-dev is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Collaborator
|
Excellent addition. Thanks @ysm-dev! |
f01c33
added a commit
to f01c33/agent-browser
that referenced
this pull request
Mar 17, 2026
…ol normalisation Extends vercel-labs#874's HarEntry struct and CDP handlers with richer capture: - wall_time (f64) replaces pre-formatted started_date_time, preserving sub-second precision from CDP wallTime for accurate RFC 3339 output - request_headers / response_headers changed from Value to Vec<(String,String)> for typed access without re-parsing JSON objects - post_data captured from Network.requestWillBeSent for HAR postData - cdp_timing and loading_finished_timestamp captured from responseReceived and loadingFinished respectively, enabling har_compute_timings to produce accurate blocked/dns/connect/ssl/send/wait/receive phases - har_cdp_protocol_to_http_version normalises CDP protocol strings (h2 -> HTTP/2.0, h3 -> HTTP/3.0, etc.) - Request cookies parsed from Cookie header; response cookies from Set-Cookie with ';'-first split to correctly strip Path/HttpOnly attributes before '=' - har_wall_time_to_rfc3339 replaces har_started_date_time, using the time crate directly on the f64 epoch value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merged
ctate
pushed a commit
that referenced
this pull request
Mar 17, 2026
* feat: enhance HAR entries with timings, cookies, postData, and protocol normalisation Extends #874's HarEntry struct and CDP handlers with richer capture: - wall_time (f64) replaces pre-formatted started_date_time, preserving sub-second precision from CDP wallTime for accurate RFC 3339 output - request_headers / response_headers changed from Value to Vec<(String,String)> for typed access without re-parsing JSON objects - post_data captured from Network.requestWillBeSent for HAR postData - cdp_timing and loading_finished_timestamp captured from responseReceived and loadingFinished respectively, enabling har_compute_timings to produce accurate blocked/dns/connect/ssl/send/wait/receive phases - har_cdp_protocol_to_http_version normalises CDP protocol strings (h2 -> HTTP/2.0, h3 -> HTTP/3.0, etc.) - Request cookies parsed from Cookie header; response cookies from Set-Cookie with ';'-first split to correctly strip Path/HttpOnly attributes before '=' - har_wall_time_to_rfc3339 replaces har_started_date_time, using the time crate directly on the f64 epoch value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: apply cargo fmt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
9 tasks done
leeguooooo
referenced
this pull request
in leeguooooo/chrome-use
Sep 15, 2026
Expose HAR recording as a CLI subcommand under the existing `network` command so users can capture and export network traffic without a separate tool or opening the browser twice. - Parse `network har start` and `network har stop [path]` in commands.rs - Enrich HarEntry with request/response headers, timestamps, status text, resource type, HTTP version, and body sizes from CDP events - Produce HAR 1.2 output with creator/browser metadata, query strings, and proper header arrays compatible with Chrome DevTools HAR viewer - Auto-generate output path under ~/.agent-browser/tmp/har/ when omitted - Add har_stop to skip_launch list so export works without a live browser - Update help text, README, docs site, SKILL.md, and security policy docs - Add unit tests for parsing, HAR entry serialization, and stop behavior
leeguooooo
referenced
this pull request
in leeguooooo/chrome-use
Sep 15, 2026
* feat: enhance HAR entries with timings, cookies, postData, and protocol normalisation Extends #874's HarEntry struct and CDP handlers with richer capture: - wall_time (f64) replaces pre-formatted started_date_time, preserving sub-second precision from CDP wallTime for accurate RFC 3339 output - request_headers / response_headers changed from Value to Vec<(String,String)> for typed access without re-parsing JSON objects - post_data captured from Network.requestWillBeSent for HAR postData - cdp_timing and loading_finished_timestamp captured from responseReceived and loadingFinished respectively, enabling har_compute_timings to produce accurate blocked/dns/connect/ssl/send/wait/receive phases - har_cdp_protocol_to_http_version normalises CDP protocol strings (h2 -> HTTP/2.0, h3 -> HTTP/3.0, etc.) - Request cookies parsed from Cookie header; response cookies from Set-Cookie with ';'-first split to correctly strip Path/HttpOnly attributes before '=' - har_wall_time_to_rfc3339 replaces har_started_date_time, using the time crate directly on the f64 epoch value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: apply cargo fmt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
tahodev
pushed a commit
to tahodev/agent-browser
that referenced
this pull request
Oct 20, 2026
…-labs#874) Expose HAR recording as a CLI subcommand under the existing `network` command so users can capture and export network traffic without a separate tool or opening the browser twice. - Parse `network har start` and `network har stop [path]` in commands.rs - Enrich HarEntry with request/response headers, timestamps, status text, resource type, HTTP version, and body sizes from CDP events - Produce HAR 1.2 output with creator/browser metadata, query strings, and proper header arrays compatible with Chrome DevTools HAR viewer - Auto-generate output path under ~/.agent-browser/tmp/har/ when omitted - Add har_stop to skip_launch list so export works without a live browser - Update help text, README, docs site, SKILL.md, and security policy docs - Add unit tests for parsing, HAR entry serialization, and stop behavior
tahodev
pushed a commit
to tahodev/agent-browser
that referenced
this pull request
Oct 20, 2026
* feat: enhance HAR entries with timings, cookies, postData, and protocol normalisation Extends vercel-labs#874's HarEntry struct and CDP handlers with richer capture: - wall_time (f64) replaces pre-formatted started_date_time, preserving sub-second precision from CDP wallTime for accurate RFC 3339 output - request_headers / response_headers changed from Value to Vec<(String,String)> for typed access without re-parsing JSON objects - post_data captured from Network.requestWillBeSent for HAR postData - cdp_timing and loading_finished_timestamp captured from responseReceived and loadingFinished respectively, enabling har_compute_timings to produce accurate blocked/dns/connect/ssl/send/wait/receive phases - har_cdp_protocol_to_http_version normalises CDP protocol strings (h2 -> HTTP/2.0, h3 -> HTTP/3.0, etc.) - Request cookies parsed from Cookie header; response cookies from Set-Cookie with ';'-first split to correctly strip Path/HttpOnly attributes before '=' - har_wall_time_to_rfc3339 replaces har_started_date_time, using the time crate directly on the f64 epoch value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: apply cargo fmt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
network har startandnetwork har stop [path]CLI subcommands for recording and exporting network traffic as HAR 1.2 fileshar_start/har_stopdaemon actions with full request/response metadatahar_stopis added to the skip-launch list so export works without re-launchingChanges
CLI parsing (
cli/src/commands.rs):harto validnetworksubcommandsnetwork har start->{ "action": "har_start" }network har stop [path]->{ "action": "har_stop", "path": "..." }HAR capture & export (
cli/src/native/actions.rs):HarEntrystruct with request/response headers,statusText,startedDateTime(from CDPwallTime), resource type, HTTP version, and body sizesNetwork.requestWillBeSentheaders/wallTime/type,Network.responseReceivedstatusText/headers/protocol/encodedDataLength, andNetwork.loadingFinishedfor final transfer sizecreator/browsermetadata, proper[{name, value}]header arrays, query string parsing, and redirect URL extraction~/.agent-browser/tmp/har/when no path is providedhar_stoptoskip_launchlist so export does not trigger browser auto-launchHelp & output (
cli/src/output.rs):har_startnow prints "HAR recording started" instead of generic "Recording started"har_stopnow prints request count alongside the saved pathnetwork --helpand summary help textDocumentation:
README.md: Addednetwork har start/stopexamplesdocs/src/app/commands/page.mdx: Added HAR commands to network sectiondocs/src/app/security/page.mdx: Updated network action policy to includehar start/stopskills/agent-browser/SKILL.md: Added HAR recording examples for AI agentsDependencies (
cli/Cargo.toml):timecrate (v0.3,formattingfeature) for RFC 3339 timestamp formattingTesting
cargo test-- 470 passed, 0 failed, 29 ignoredcargo fmt --check-- cleantest_network_har_start,test_network_har_stop_with_path,test_network_har_stop_without_path,test_network_har_requires_subcommand,test_har_entry_json_enriches_request_and_response,test_har_started_date_time_uses_rfc3339,test_handle_har_stop_without_path_uses_default_location,test_execute_har_stop_skips_browser_auto_launch,test_browser_metadata_from_version_parses_productUsage
agent-browser open https://example.com agent-browser network har start # ... navigate, interact ... agent-browser network har stop ./capture.harIf no path is given to
stop, a timestamped file is written to~/.agent-browser/tmp/har/.This contribution was developed with AI assistance (Claude Code).