Home > Net >  How to make browser developer tools save HAR file containing untruncated response?
How to make browser developer tools save HAR file containing untruncated response?

Time:09-26

Sometimes my HTTP responses have rather large content (maybe about 5 MB) and I want to save those together with the rest of the requests in the HAR file. However, the HAR file sometimes only contains part of the response content and sometimes only headers etc but nothing of the content at all. I tried most recent Chrome, Chromium and Firefox browsers.

To reproduce: Open developer tools, record, open a site that returns a large HTTP response (like a big photo JPEG or something) and save the HAR file. It will be much smaller than the size of the JPEG image.

Where is the setting so I can make the developer tool save the full response with the HAR file?

CodePudding user response:

*** Disclaimer: Answer by HttpWatch Developer ***

Our HttpWatch software (Windows only) that works with Chrome and Edge can help you do this. Its default file format (HWL) contains a complete log of all responses whatever their size. The log files can be opened for visual inspection in HttpWatch Studio or examined programmatically using the HttpWatch API.

It can export to HAR files without any restriction on response body size but currently this is only possible using the ExportHAREx automation method:

https://apihelp.httpwatch.com/HttpWatch_API~HttpWatch.Log~ExportHAREx.html

If you save HAR files directly from the HttpWatch browser extensions response bodies are limited to 50 kB.

You can try HttpWatch for free:

https://www.httpwatch.com/download/

or contact [email protected] for more information

CodePudding user response:

Here is a partial answer for Firefox, at least.

This is the bug report, which induces the patch: https://bugzilla.mozilla.org/show_bug.cgi?id=1223726 Open about:config and change devtools.netmonitor.responseBodyLimit from default value 1048576 to your desired size in bytes.

  • Related