How to record a HAR file

How to save a HAR in each browser, how to keep requests across a reload, and what to check in the file before you send it to support.

What the file is and why you are asked for it

A HAR records every request a page made, with headers, response bodies and phase timings: which request failed, what the server answered, how long it took. Every major browser saves one. How to read it: the HAR viewer page.

Chrome, Edge and other Chromium browsers

Chrome, Edge, Brave, Opera and Yandex Browser share the Chromium developer tools.

  1. Open the developer tools: F12 or Ctrl+Shift+I, on macOS Cmd+Option+I, or three dots → More tools → Developer tools.
  2. Switch to the Network tab.
  3. Tick Preserve log, so the log survives reloads and navigation.
  4. Press the clear icon (a crossed-out circle).
  5. Reproduce the problem.
  6. Press the download arrow in the tab's toolbar (Export HAR (sanitized)…) and save the file.

Since version 130 Chrome leaves the Cookie, Set-Cookie and Authorization headers out. They are rarely needed. For the full file, turn on Allow to generate HAR with sensitive data in the developer tools settings (Settings → Preferences → Network), then long-press the export button and pick Export HAR (with sensitive data)….

Firefox

  1. Open the developer tools: F12 or Ctrl+Shift+I, on macOS Cmd+Option+I.
  2. Switch to the Network tab.
  3. In the gear menu at the right of the toolbar, turn on Persist Logs.
  4. Reproduce the problem.
  5. In the same menu, choose Save All as HAR.

Firefox keeps cookies and authorization headers in the file.

Safari

  1. Once: Safari → Settings → Advanced → Show features for web developers.
  2. Develop → Show Web Inspector (Cmd+Option+I), tab Network.
  3. Reproduce the problem.
  4. Press the export icon in the tab's toolbar and save the .har file.

Safari does not filter the file either.

If the problem is on a phone

Mobile browsers do not save a HAR. Record it from a computer:

  • Android and Chrome. Turn on USB debugging in the developer options, connect the phone by cable, open chrome://inspect on the computer and press inspect under the page. Then as in the Chrome section.
  • iPhone and Safari. On the phone: Settings → Apps → Safari → Advanced → Web Inspector (before iOS 18: Settings → Safari → Advanced). Connect it to a Mac, then in Safari on the Mac: Develop → the phone's name → the page. Then as in the Safari section.

An app's traffic is recorded by a proxy, not a browser: see traffic from a phone.

What to check before you send it

Open the file in the viewer and search for Authorization, Cookie, token, password. If such values are there and need not be shared, record again in Chrome without sensitive data. Chrome drops only those three headers: tokens in URLs and bodies stay. After sending, sign out of the site: that usually ends the session the file holds.

A file of hundreds of megabytes will not go through email. Clear the log right before the error. If it is still large, zip it.

See it on your own traffic

A browser records only its own tabs. A debugging proxy records any program that goes through it: a browser, a desktop app, a phone. Solpuga saves a session as HAR 1.2 from Tools → Export Session as HAR… (Cmd/Ctrl + Shift + E) or the download button in the title bar. Unfinished requests are left out and binary request bodies are not saved. Details: Capture & Inspect Traffic.

View in Solpuga

Tool for this page

HAR viewerOpen a HAR file and read the requests, headers, bodies and timings.

Related