moon icon indicating copy to clipboard operation
moon copied to clipboard

Increased useful data in HAR file

Open dkuznetsov21 opened this issue 1 year ago • 1 comments

Problem

Currently, the HAR file lacks sufficient information since the responses are missing in the requests. Therefore, we need to include responses.

However, after adding the responses, the HAR file becomes very large. We need to figure out a way to reduce its size.

Suggested Solutions

  • Compression: Compress the file into an archive.
  • Selective Capture: Record only fetch/XHR (potentially WebSocket) requests, since these are relevant in 99% of cases.
  • Options for Customization: Introduce additional configuration options for HAR file generation, so users can dynamically decide what they need to capture.

Additional Reference

In the Telegram support chat, they shared how dynamic capture for HAR files is implemented. You can check it out here: https://github.com/browserup/browserup-proxy/blob/0f28ec6e8f1423e1fdb014fded72e9278bdd083f/browserup-proxy-core/src/main/java/com/browserup/bup/proxy/CaptureType.java#L15

dkuznetsov21 avatar Oct 17 '24 11:10 dkuznetsov21

would also be nice if it could be renamed. right now my tests keep overwriting it. Would like something similar to:

"moon:options": {
          name: name,
          enableVideo: true,
          videoName: `${name}.mp4`,
          enableHAR: true,
          HARName: `${name}.har.json`,
}

TD-4242 avatar May 08 '25 21:05 TD-4242