New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 720273 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocked on:
issue 374557



Sign in to add a comment

HAR log generated by chrome.devtools.network.getHAR is missing startedDateTime

Reported by xmh...@gmail.com, May 10 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0

Steps to reproduce the problem:
1. Call interface "chrome.devtools.network.getHAR" from devtools_page to dump the HAR log.
2. View the startedDateTime fields(request start time).

What is the expected behavior?
The HAR log exported by "chrome.devtools.network.getHAR" should conform to HAR 1.2 Spec.

For pages:
startedDateTime [string] - Date and time stamp for the beginning of the page load (ISO 8601 - YYYY-MM-DDThh:mm:ss.sTZD, e.g. 2009-07-24T19:20:30.45+01:00).

or 

For entries:
startedDateTime [string] - Date and time stamp of the request start (ISO 8601 - YYYY-MM-DDThh:mm:ss.sTZD).

What went wrong?
The startedDataTime in HAR log exported by "chrome.devtools.network.getHAR" is not a string, but an empty JSON object without any time stamp information.

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 58.0.3029.96 (Official Build) (64-bit)  Channel: stable
OS Version: Windows 7
Flash Version: Shockwave Flash 24.0.0.189
 
getHar_startedDateTime_JSON.jpg
67.1 KB View Download
Cc: littledan@chromium.org adamk@chromium.org ligim...@chromium.org
Labels: Needs-Triage-M58
This may be related to the below mentioned issues not sure though. But missing DateTime seems to be a bug.Looping to folks who is working on these bugs for further input.

https://bugs.chromium.org/p/chromium/issues/detail?id=714301
https://bugs.chromium.org/p/chromium/issues/detail?id=716167

Comment 2 by xmh...@gmail.com, May 11 2017

I'm not able to view the issue
https://bugs.chromium.org/p/chromium/issues/detail?id=714301
Reason: User is not allowed to view this issue 

The issue described in "https://bugs.chromium.org/p/chromium/issues/detail?id=716167" is not the same as what I reported here.

We are developing a Chrome extension to get HAR log once after a page is loaded. This issue is blocking us from analyzing the result. During the period of developers from chromium project investigate this issue, is there any workaround? Can I use chrome.debugger.* API to achieve the some goal? I searched about this API, some guys said it is low level APIs with limited documentation, I hesitate to try it...

Thanks!
Components: -Blink>Network Platform>DevTools
Labels: TE-NeedsTriageHelp

Comment 5 by l...@chromium.org, May 18 2017

Cc: caseq@chromium.org
Owner: allada@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report.  When I do "chrome.devtools.network.getHAR(x => console.log(x.entries[0].startedDateTime))" in console, it looks like the result is a Date object, not a string.  The HAR log spec does indicate it should be a string value.

As for a workaround, your callback to getHAR could call .toString() on the startedDateTime field, and JSON.stringify() should still correctly show the date in ISO format.

allada@, could you please take a look?  cc'ing caseq@ for DevTools extension knowledge.

Comment 6 by l...@chromium.org, May 18 2017

Components: Platform>Extensions>API

Comment 7 by xmh...@gmail.com, May 22 2017

luoe,

Thanks for the workaround! I use toISOString() on the field in the callback, works! Not sure why I observed an empty object, may be it lose its content on the way when devtools.js post message to background.js then to content.js. Anyway, thanks again!
Labels: -Hotlist-Interop

Comment 9 by allada@chromium.org, Jul 11 2017

Blockedon: 374557
Status: Fixed (was: Assigned)
This should have been fixed.

Sign in to add a comment