How to Capture a HAR File in Chrome, Firefox, and Edge (Without Leaking Secrets)
Capture a HAR in Chrome, Edge, and Firefox in under a minute. Then learn exactly what a sanitized export strips, what it leaves behind, and how to share the file without handing over a live session.

A HAR file is the single most useful artifact you can attach to a network bug, and the easiest one to leak credentials with. It is plain-text JSON that records every request the browser made, including headers, cookies, query strings, and frequently the request and response bodies. Captured carelessly and pasted into a public ticket, it hands a stranger everything needed to replay your logged-in session.
This guide does two things the vendor docs skip. First, the exact click path in Chrome, Edge, and Firefox. Second, an honest threat model: what the new sanitized export actually removes, what it quietly leaves behind, and the redaction pass you still owe before the file leaves your machine.
What is a HAR file, in one paragraph
A HAR (HTTP Archive) file is a JSON log of a browser session's network activity. Its root log object holds an entries array, and each entry's request object carries a headers array and a cookies array. That structure is exactly where Authorization tokens, Cookie values, and Set-Cookie session IDs live, and exactly what a careless share exposes.
Because the format is standardized, the same .har file opens in Chrome, Edge, Firefox, Charles, and most API tooling. It is also machine-readable: the WebExtensions devtools.network.getHAR() call resolves to the same log object with a version field and an entries array, which is what an automated capture or an AI agent parses programmatically. The structure that makes HAR portable is the same structure that makes it dangerous, so capture is only half the job.
Capture a HAR in Chrome
- Open DevTools. Press F12 or Ctrl+Shift+I (Cmd+Option+I on macOS).
- Select the Network tab. Make sure the red record dot is on.
- Reload the page with DevTools open so requests are recorded from the first byte. Keep it open and reproduce the bug.
- Export. Click the download/Export icon in the Network action bar and choose Export HAR (sanitized), or right-click any request and pick Save all as HAR (sanitized).
DevTools writes every request captured since you opened the panel into one .har file. Since Chrome 130 (documented 30 September 2024), the default export no longer contains Cookie, Set-Cookie, or Authorization headers. If you genuinely need them for the repro, you must opt in under Settings > Preferences > Network > 'Allow to generate HAR with sensitive data' — and then treat the result as a live credential.
Capture a HAR in Edge
Microsoft Edge ships the same Chromium DevTools, so the flow matches Chrome. Open the Network tool, reload, reproduce, then either right-click a request and choose Copy > Copy all as HAR (sanitized) or click the Export HAR (sanitized) button in the action bar. Edge's documentation (updated 3 April 2026) confirms the sanitized HAR excludes the same three header families — Cookie, Set-Cookie, and Authorization — and that including them requires the matching Allow to generate HAR with sensitive data checkbox. To inspect a teammate's file, use Import HAR file from the same action bar.
Capture a HAR in Firefox (the outlier)
Firefox's Network Monitor hides HAR behind the toolbar overflow menu. Open it, reload, reproduce, then click the overflow menu and choose one of three verbatim items: Save All As HAR (opens a file dialog with the .har extension), Copy All As HAR (puts it on the clipboard), or Import HAR to load one back.
Here is the catch most guides miss: Firefox does not strip auth and cookie headers by default the way Chrome and Edge now do. A Firefox HAR ships your Cookie and Authorization values as captured. Manual redaction is not optional there — it is the only thing standing between the file and a session takeover.

What 'sanitized' removes — and what it does not
This is the part that sinks teams. The sanitized export is a header filter, not a secret scrubber. In both Chrome and Edge it removes exactly three header families and stops there:
Cookie— your outgoing session cookies.Set-Cookie— session IDs the server hands back.Authorization— bearer tokens and basic-auth credentials.
That blocks the most common session-hijack vector. It does nothing about secrets living anywhere else in the entry. A bearer token in a request URL or query string survives. An API key inside a POST body survives. PII and access tokens inside a JSON response body survive. The HAR spec puts request and response bodies in the same entries structure, and the sanitized pass never reads them.
Read that chart as a checklist of what you still have to do. The three lime bars are handled for you on Chrome and Edge. The three empty bars are your job, on every browser.
How to share a HAR without leaking secrets
A repeatable pre-share pass takes about a minute and saves a credential-rotation fire drill:
- Export the sanitized version first. On Firefox, skip nothing — assume cookies and auth headers are present.
- Search the file for
token,authorization,password,apikey,email, and your own username. Redact matches in both headers and bodies. - Strip URL secrets. Bearer values and session tokens hide in
request.urlquery strings; the sanitized pass ignores them. - Share over a private channel — an access-controlled ticket or DM, never a public issue or pastebin.
- Delete the file once the bug closes. If a non-sanitized HAR ever left your machine, rotate the exposed credential.
# Quick triage: which entries carry the headers a sanitized export missed?
# (Firefox HARs in particular still include these.)
jq '.log.entries[].request.headers[]
| select(.name | ascii_downcase
| test("authorization|cookie|x-api-key"))' capture.har
# List every request URL so you can eyeball tokens in query strings
jq -r '.log.entries[].request.url' capture.har | grep -i 'token\|key\|sig='A HAR is only the network slice
A HAR answers what did the browser send and receive. It is silent on what the user saw and did. When a request returns a 500, the HAR shows the failed call but not the click that triggered it, the DOM state at that moment, or the console error thrown on the page. You reconstruct that by hand from a screenshot and a description — which is exactly the back-and-forth a HAR was supposed to end.
This is the gap BugMojo closes. A capture pairs the failing request with the correlated rrweb DOM recording and the console output, and redacts PII client-side before anything leaves the browser. The same bundle is readable by an AI coding agent over MCP, so Claude Code or Cursor can read the request, the DOM, and the error together instead of triaging a stripped JSON file in isolation.
| Feature | Sanitized HAR file | BugMojo capture |
|---|---|---|
| Records the network layer | ✓ | ✓ |
| Strips Cookie / Set-Cookie / Authorization | Chrome/Edge only | ✓ |
| Redacts URL tokens, body keys, and response PII | — | client-side |
| Correlates the request with DOM + console | — | ✓ |
| Readable by an AI agent over MCP | — | ✓ |
| Opens in any browser / Charles with no install | ✓ | — |
| Captures traffic with zero setup, anywhere | ✓ | needs the extension |
Frequently asked questions
Frequently asked questions
Sources
- Network features reference — save/export HAR, sanitized export, and 'Allow to generate HAR with sensitive data' — Google / Chrome for Developers (2024-2026)
- What's new in DevTools, Chrome 130 — HAR export no longer contains Cookie, Set-Cookie, and Authorization headers by default — Google / Chrome for Developers (2024-09-30)
- Network features reference — Microsoft Edge DevTools (Copy/Export HAR (sanitized), Import HAR file) — Microsoft Learn (2026-04-03)
- Network monitor toolbar — Save All As HAR, Copy All As HAR, Import HAR — Mozilla / Firefox Source Docs (2024-2026)
- HTTP Archive (HAR) format specification — log → entries → request → headers[]/cookies[] — W3C Web Performance Working Group (draft) (2012 draft, still hosted)
- devtools.network.getHAR() — returns a HAR log object for the current tab — MDN Web Docs (2025-07-17)
Get bug-tracking insights, weekly.
Engineering deep-dives, QA playbooks, and honest tool comparisons. No spam — unsubscribe in one click.

