cyrus-and / chrome-har-capturer

Capture HAR files from a Chrome instance
MIT License
530 stars 90 forks source link

Design API capture time #65

Closed twrandolphchen closed 5 years ago

twrandolphchen commented 5 years ago

Hi, Sorry for bothering you, I tried to execute this URL: http://www.buzzorange.com for too long to wait. Can the tool design option for capture har time? Many thanks!

cyrus-and commented 5 years ago

What do you mean exactly? The -u, --timeout <ms> option is time to wait before giving up with a URL if it takes too much time.

twrandolphchen commented 5 years ago

I thought the -u, --timeout option just like Chrome "stop recording network log" , but when timeout I cannot get any result.

By the way, I tried https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js get ("headersSize": -1, "bodySize": -1) , Is this a bug ? thanks.

twrandolphchen commented 5 years ago

Hi, I just read the comment // From Chrome: // - responseHeaders.size: size of the headers if available (otherwise // -1, e.g., HTTP/2) // - entry.responseLength: actual decoded body size // - entry.encodedResponseLength: total on-the-wire data // // To HAR: // - headersSize: size of the headers if available (otherwise -1, e.g., // HTTP/2) // - bodySize: encoded body size // - _transferSize: total on-the-wire data // - content.size: decoded body size // - content.compression: decoded body size - encoded body size

Why HTTP/2 can't support headersSize & bodySize ?

cyrus-and commented 5 years ago

I thought the -u, --timeout option just like Chrome "stop recording network log" , but when timeout I cannot get any result.

Because the page has not finished loading so the HAR would be incomplete.

Why HTTP/2 can't support headersSize & bodySize ?

Because Chrome doesn't provide that information and I cannot compute it due to the fact that headers are compressed in HTTP/2.