TIL what a HAR file is. HAR stands for HTTP Archive.
It’s pretty straightforward to generate one.
- Open browser’s dev console -> network tab
- Enable
Preserve log
- The export HTTP request option should be enabled
If the export button is disabled, it’s likely because Preserve log wasn’t enabled when the DevTools first opened. A simple refresh (
Ctrl/Cmd + R
) should fix it.
- You can now export either selected requests or the entire log history. The browser will prompt you to save the .har file—just name it something useful and store it.
Later, if you need to revisit that captured state, simply drag the .har
file back into the Network tab.
Now if I had to capture or reproduce a bug, I would for sure think of generating/accessing a .har file when possible. Great for bug reproduction and fixes.
Honestly, I can’t believe that I didn’t know about this sooner.