How it works
The file is parsed as JSON and read as HAR 1.2: log.entries holds one object per request, with the request, the response and its content, the timings and the moment it started. Every entry becomes a row — method, URL split into host and path, status, type, transfer size and time — and the earliest start in the file becomes zero, so each row’s position is how many milliseconds after that it began. The waterfall is drawn against the whole span, from the first start to the last finish, with each bar divided into coloured segments in proportion to its timing phases.
Browsers add fields of their own, and they are used when present. Chrome’s _resourceType decides whether a row is a document, Fetch/XHR, script or image, with the MIME type as the fallback; _transferSize is the bytes over the wire, falling back to the body and header sizes; a request with status 0 or an _error is marked failed; a 200 with no bytes transferred is marked as served from cache. Two timing details are tidied: HAR counts the TLS handshake inside connect, so it is subtracted out to give separate Connect and TLS phases, and the -1 a browser writes for a phase that did not happen becomes zero.
The sanitiser walks the same JSON and replaces rather than removes. Every cookie, headers such as Authorization, Cookie and X-API-Key, and any query parameter, form field or JSON key whose name looks like a secret — password, token, api_key, session, signature, code and so on — become [REDACTED], and credentials inside a URL are redacted wherever that URL is repeated: the HTTP/2 :path, the Referer, Location and Link headers, the redirect target, Chrome’s initiator and the page title. Base64-stored text bodies are decoded, redacted and re-encoded. The copy is written as a download from the same tab, and the file itself never leaves the browser.