chromeHAR icon indicating copy to clipboard operation
chromeHAR copied to clipboard

HAR files of remote debugging don't work

Open IcyT opened this issue 9 years ago • 2 comments

When I debug an android device remotely the HAR file is not working in your viewer. In the console, I can see the following error:

TypeError: Cannot read property 'startedDateTime' of undefined
    at Object.<anonymous> (http://ericduran.github.io/chromeHAR/js/controllers.js:99:73)
    at Function.x.extend.each (http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js:4:4575)
    at Object.$scope.updateHar (http://ericduran.github.io/chromeHAR/js/controllers.js:97:9)
    at http://ericduran.github.io/chromeHAR/js/controllers.js:271:20
    at Object.g.$eval (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js:104:502)
    at Object.g.$apply (http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0rc1/angular.min.js:105:102)
    at FileReader.reader.onload (http://ericduran.github.io/chromeHAR/js/controllers.js:270:18) 

So I had a look into the code in line 99 of controllers.js and it is calling:

pages[0].startedDateTime

I had a look into the HAR file then and I've seen that the pages are an empty array:

"pages": [],

I could reproduce it on some different devices. Maybe it's not empty for all devices, but it was for the devices I tested.

IcyT avatar Oct 30 '14 09:10 IcyT

hmm, I thought startedDateTime was part of the spec, but maybe the HAR is not a full page request which is probably why it's missing.

ericduran avatar Oct 30 '14 21:10 ericduran

Yes, I think it wasn't a full page request. I cleared the network tab in Chrome and recorded some AJAX calls that were made after some time. This is useful to examine specific calls. I'm not aware of the spec but nevertheless it would be useful if your tool allows to view the files anyway. I could get it ro run locally with a quick workaround by faking a pages entry if it is an empty array. But I think this is not a clean solution.

IcyT avatar Oct 31 '14 09:10 IcyT