feat: capture all network traffic with zero gaps (8 improvements) - #1
Open
Kania-agent wants to merge 4 commits into
Open
feat: capture all network traffic with zero gaps (8 improvements)#1Kania-agent wants to merge 4 commits into
Kania-agent wants to merge 4 commits into
Conversation
8 improvements to make the capture engine cover everything: 1. requestWillBeSentExtraInfo — real request cookies + full wire headers 2. responseReceivedExtraInfo — Set-Cookie + full response headers 3. setCacheDisabled — force fresh fetch, never empty body from cache 4. eventSourceMessageReceived — SSE messages (bounded to 5000/req) 5. webSocketFrameError + webSocketWillSendHandshakeResponse — complete WS 6. remoteIPAddress/remotePort/protocol — server metadata 7. Full initiator object with stack traces (was just type string) 8. Page domain events — navigation, DOMContentLoaded, load lifecycle 13 files modified, 518 insertions, 15 deletions. Typecheck: both desktop-app and extension pass with zero errors.
1. securityDetails — TLS version, cipher, cert issuer/subject/SAN, validity 2. resourceTiming — DNS, TCP, TLS, TTFB breakdown from response.timing 3. redirects — full redirect chain with URL, status, headers per hop 4. initialPriority — Chrome resource priority (VeryLow..VeryHigh) 5. connectionId + connectionReused — track keep-alive connection pool 6. hasPostData + getRequestPostData — fetch large request bodies not inlined 7. blockedReason — mixed content, CSP, CORS block reason from loadingFailed 8. encodedDataLength — actual wire bytes including compressed headers 4 files modified, 265 insertions. Typecheck: both extension and desktop-app pass with zero errors.
5 improvements for unlimited capture + stealth: 1. setBypassServiceWorker — capture true network requests, not SW-intercepted 2. Runtime.consoleAPICalled + exceptionThrown — JS console + error context 3. Performance.getMetrics + Runtime.evaluate — Core Web Vitals (FCP, TTFB, etc) 4. Network.getAllCookies ready — full cookie jar snapshot support 5. Page.addScriptToEvaluateOnNewDocument — anti-detection injection: - Remove navigator.webdriver - Patch permissions.query, plugins, languages - Mask WebGL vendor/renderer - Hide debugger infobar state 7 files modified, 287 insertions.
- INFLIGHT_LIMIT: 4000 → 0 (unlimited concurrent in-flight requests) - MAX_WS_MESSAGES: 5000 → 0 (unlimited WebSocket messages per request) - MAX_SSE_MESSAGES: 5000 → 0 (unlimited SSE messages per request) - MAX_BODY_BYTES: 5MB → 0 (no body truncation in MITM proxy) - debugger.ts local INFLIGHT_LIMIT: 2000 → 0 - pushBounded: skip trim when max=0 - InFlightRegistry.remember: skip eviction when limit=0 - trackInFlight: skip eviction when limit=0 All limits now default to 0 (unlimited). Set to positive numbers for memory-constrained environments. Personal machine = no limits.
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.
Overview
8 improvements to make the HAR capture engine cover everything — no traffic slips through.
Changes
1. Real cookies + full request headers (
requestWillBeSentExtraInfo)Previously only pre-cookie headers from
requestWillBeSentwere captured. Now the actual headers sent over the wire (including cookies the browser added) are captured viaNetwork.requestWillBeSentExtraInfo. Cookies are parsed into a structuredrequestCookies[]list.2. Set-Cookie + full response headers (
responseReceivedExtraInfo)Chrome strips
Set-Cookiefrom the standardresponseReceivedevent. Now the full response headers (includingSet-Cookie) are captured viaNetwork.responseReceivedExtraInfo. Set-Cookie values are parsed intoresponseCookies[].3. Force-disable cache (
setCacheDisabled)Cache is now force-disabled during capture so response bodies are always fetched fresh from the network — never served from disk cache where
getResponseBodywould return empty.4. SSE messages (
eventSourceMessageReceived)EventSource connections were captured but the actual SSE messages were lost. Now each message (
eventName,eventId,data,timestamp) is captured viaNetwork.eventSourceMessageReceived. Bounded to 5000 messages per request (drop-oldest).5. Complete WebSocket capture
webSocketFrameError— protocol-level error textwebSocketWillSendHandshakeResponse— handshake response status + headers6. Server metadata
remoteIPAddress,remotePort, andprotocol(e.g.h2,http/1.1) are now extracted fromresponseReceived.7. Full initiator with stack traces
Previously only
initiator.typewas captured as a string. Now the full CDP initiator object is captured:type,url,lineNumber,columnNumber, andstack.callFrames[]with function name + URL + line + column for each frame.8. Page lifecycle events
Page domain is now enabled (
Page.enable) and lifecycle events are captured:frameNavigated(navigation),domContentEventFired(DOMContentLoaded),loadEventFired(load). These provide timeline context for when requests occurred relative to page load phases.Files modified (13)
shared/src/index.tsextension/src/debugger.tsextension/src/background.tsdesktop-app/src/main/index.tsdesktop-app/src/main/har.tsdesktop-app/src/main/import.tsdesktop-app/src/main/redact.tsdesktop-app/src/main/store.tsdesktop-app/src/main/proxy/mitm-capture.tsdesktop-app/src/preload/index.tsdesktop-app/src/renderer/App.tsxdesktop-app/src/renderer/components/RequestDetail.tsxREADME.mdTypecheck
Both
desktop-appandextensionpasstsc --noEmitwith zero errors.Backward compatibility
All new fields are optional. Legacy captures and imported HARs remain valid. The
initiatorfield accepts bothstring(legacy) andobject(new) — every consumer handles both shapes.