chrome-har icon indicating copy to clipboard operation
chrome-har copied to clipboard

Add option to skip deleteInternalProperties()

Open jancurn opened this issue 6 years ago • 4 comments

It would be awesome if there was an option to keep the internal properties of the HAR entries, such as __requestId. This would allow us to make extensions to the HAR, e.g. to add the raw content of the requests. Is that something you'd consider adding? If yes, I can prepare a pull request.

jancurn avatar Jul 13 '18 13:07 jancurn

Hi @jancurn yes that sounds cool. Do you see other use cases than __requestId? I checked the HAR from WebPageTest and they expose __requestId as _request_id, so I'm thinking we should follow the same pattern, then https://github.com/micmro/PerfCascade can use the same to show the id both for WPT and chrome-har? Ping @tobli

Best Peter

soulgalore avatar Jul 13 '18 19:07 soulgalore

Actually currently I only need __requestId, so the solution you're suggesting would work. If you give me green light, I'll prepare a PR that stores __requestId as _request_id.

jancurn avatar Jul 14 '18 18:07 jancurn

Sounds good, please go ahead @jancurn :)

soulgalore avatar Jul 14 '18 20:07 soulgalore

Hi! Late to the game, on vacation. The internal properties (prefixed with __) are implementation details that can (and have) change, so exposing them as external API is not intended. If there's precedence from WebPageTest to expose the Chrome request as _request_id however, I think that's ok to do always, and not add a preference for that. We do already add a bunch of WPT extensions, so one more field doesn't require an added preference. Note however that the the __requestId for HAR entries doesn't correspond exactly to the request id from Chrome events, for redirect events the id of the previous entry is altered to add an 'r' (see https://github.com/sitespeedio/chrome-har/blob/a294335668dfca26108e57c6509a0adf698628d0/index.js#L323).

tobli avatar Jul 17 '18 10:07 tobli