Mock API Routes
Return a fixed response for any URL pattern without hitting a real server:Route mocks apply to the current session only. They are cleared automatically when the session ends. Always call
clear-routes before switching to a different test scenario within the same session.Block URLs
Prevent specific requests from leaving the browser entirely. This is useful for eliminating analytics noise, ad networks, and third-party tracking during automation:Export a HAR File
Export all captured network traffic for the current session as a HAR 1.2 JSON file. GSD Browser records every request automatically — export the buffer at any point:.har file in HAR Analyzer or import it directly into browser DevTools for inspection.
The network buffer accumulates continuously. Call
gsd-browser network --clear if you want to reset the capture window before a specific flow, then export with har-export afterward.Run a CDP Trace
Capture a Chrome DevTools Protocol performance trace for deep profiling of rendering, scripting, and network timing:Perform the flow you want to profile
Navigate, interact, and exercise the code paths you want to measure.
chrome://tracing or Perfetto to visualize the timeline.
Inspect the Network Log
Read the current network log at any time without exporting a full HAR:--json for programmatic parsing:
Use Cases
Test against mock APIs
Set up route mocks before navigating so your automation runs against controlled data — no test accounts, seeding, or teardown required.
Block noise during automation
Block analytics, ad, and telemetry URLs to eliminate flakiness from slow third-party requests and keep your HAR files clean and focused.
Capture traffic for debugging
Use
har-export after a problematic flow to capture every request. Share the .har file with your team or attach it to a bug report.Performance profiling
Use CDP traces alongside HAR captures to correlate network timing with rendering and scripting bottlenecks on complex pages.
Common Patterns
Test an error state without touching the server
Test an error state without touching the server
Full network audit of a page load
Full network audit of a page load
Clean automation run (no third-party noise)
Clean automation run (no third-party noise)
