A HAR (HTTP Archive) file is a recording of everything a web page loaded: each request, its headers, how long it took, and often the response itself. Support teams ask for one when a site misbehaves, and developers save them to look into slow or failing pages. Reading one normally means loading it back into a browser's developer tools.
A HAR file also holds the cookies and sign-in headers that were sent, and often tokens and passwords in addresses and form fields, which can let whoever has it act as you on those sites. Many HAR viewers ask you to upload the file, which hands those to one more server. Here the file is read by this tab, the secrets are hidden and counted so you can see what you would be sharing, and you can save a cleaned copy with them taken out.
- Is it safe to send a HAR file to a support team?
- It can contain your cookies and sign-in tokens, which work like a password until you sign out. Send the cleaned copy from this page rather than the original, and sign out of the site afterwards, which makes any session the file still holds useless. Chrome's own "Export HAR (sanitized)" option leaves out cookies and sign-in headers too.
- What does the cleaned copy take out?
- Cookie, Set-Cookie and Authorization headers, and any header whose name mentions auth, a key, a token, a secret, a session or a cookie (X-Goog-Api-Key, X-Amz-Security-Token and the like), or whose value is a "Basic" or "Bearer" credential; a header judged secret has its whole value replaced, while HTTP/2's :authority, :method and :path headers are kept, with any secret in :path's address taken out. Also every cookie in the cookie lists; passwords written into addresses (user:password@); the values of fields named like a token, key, password, secret, session or signature, and OAuth sign-in codes, in addresses and their # fragments, Referer and redirect headers, forms and JSON, including JSON saved as text inside JSON; addresses and name=value pairs quoted inside request and response bodies, with base64 bodies decoded and looked through too; WebSocket messages; and JSON Web Tokens and keys with a telltale start (GitHub, Stripe, AWS, Slack and Google API keys) wherever they are. Scripts and style sheets are only searched for addresses and tokens, since their name=value text is code. Each is replaced by [removed], and everything else is kept, so the log still shows what happened. Secrets are found by their names and shapes, which cannot catch every custom one, such as a token under a field called "value", so give the copy a quick look before you send it.
- How do I save a HAR file?
- In Chrome or Edge, open the developer tools (F12), choose the Network tab, reload the page, then click the download arrow (Export HAR). In Firefox, right-click any request in the Network tab and choose Save All As HAR. In Safari, turn on the Develop menu first, then use Export in the Network tab.
- How do I find what made a page slow?
- Look for the longest bars on the waterfall, then click the request. A long Wait is the server taking its time to answer; long DNS, Connect or TLS times point at the network or a slow first connection; a long Receive is a large download. Requests that start late, after a gap, are often waiting on a script that ran before them.
- Why are some response bodies missing?
- Browsers do not always save them: large responses, ones from the cache, and anything after a redirect are often left out, and some exports skip bodies altogether.