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

Issue 828601 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

chrome.devtools.network.getHAR() is not working

Reported by weiting....@openx.com, Apr 3 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36

Steps to reproduce the problem:
1. use chrome.devtools.network.getHAR()

What is the expected behavior?
Should return harLog

What went wrong?
Uncaught TypeError: targetDate.getTime is not a function
    at SDK.Cookie.expiresDate (inspector.js:3603)
    at NetworkLog.HAREntry._buildCookie (inspector.js:6023)
    at Array.map (<anonymous>)
    at NetworkLog.HAREntry._buildCookies (inspector.js:6022)
    at NetworkLog.HAREntry._buildResponse (inspector.js:6009)
    at NetworkLog.HAREntry.build (inspector.js:6003)
    at NetworkLog.HARLog._convertResource (inspector.js:6039)
    at Array.map (<anonymous>)
    at NetworkLog.HARLog.build (inspector.js:6033)
    at Extensions.ExtensionServer._onGetHAR (inspector.js:7380)

Did this work before? Yes 64

Chrome version: 65.0.3325.181  Channel: stable
OS Version: OS X 10.12.6
Flash Version:
 
Note: I test it on weather.com
Labels: Needs-Bisect Needs-Triage-M65

Comment 3 by l...@chromium.org, Apr 4 2018

Owner: eostroukhov@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Thanks for filing the issue!

Checked the issue on reported chrome version 65.0.3325.181 and on 64.0.3282.186 using Mac 10.12.6 with the below mentioned steps.
1. launched Chrome
2. Navigated to weather.com
3. Inspected the page -> Console 
4. Pasted "chrome.devtools.network.getHAR()"
We observed similar error in both above mentioned Chrome versions i.e., Uncaught TypeError: Cannot read property 'network' of undefined
    at <anonymous>:1:17. 

Attaching the screen shot of the same.

@weiting.cheng: Could you please have a look at the screen shot and let us know if we have missed any steps in the process. Any further inputs from your end may help us.
828601.png
719 KB View Download
Hi Vamshi,

Thanks for your quick reply, and I don't think chrome.devtools is exposed in console. To better reproduce my problem, you can simply make a chrome devtools and add chrome.devtools.network.getHAR() to it. or 

1. Clone the code from https://github.com/angular/batarang, it's a simple devtools extension
2. add chrome.devtools.network.getHAR(), for example, added it in https://github.com/angular/batarang/blob/master/panel/hints/hints.js, which means when you click on Hint tab, it will execute getHAR
3. yarn install, yarn build
4. tried it on chrome, load unpacked, tested it on weather.com. 

Looks like it related to cookie expire date of request(I guess), and it cannot build.
And the error should be 

TypeError: targetDate.getTime is not a function
Screen Shot 2018-04-04 at 11.08.32 AM.png
147 KB View Download
And this used to be worked before 64(include), 65 isn't work.
or I found easier way to reproduce it. 

1. Go to weather.com and wait to it to load
2. Go to network tab and save har file with content
3. openx console of your devtool, you could see the error mentioned above.
Not sure if it is related to recent merge
https://chromium-review.googlesource.com/c/chromium/src/+/947255

lZkBtn3Yqe.gif
9.7 MB View Download
upload a gif to demo how to reproduce this bug without any setup.
targetDate looks like a string and not a Date.

chrome-devtools://devtools/bundled/inspector.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@dc3469be277cc962ba01d9c0cb5bb1a265676c36/&can_dock=true&dockSide=undocked

chromium-828601-typeof-targetDate.png
9.8 KB View Download
chromium-828601-typeof-targetDate-console.png
39.2 KB View Download
If I use a breakpoint to set

targetDate = new Date(targetDate)

the next error is:


chromium-828601-writeCallbacks.png
13.7 KB View Download
chromium-828601-writeCallbacks-console.png
25.1 KB View Download

Comment 16 by ajha@chromium.org, Apr 17 2018

Labels: -Needs-Feedback
This may be related to #817970
Labels: Needs-Feedback
Unable to reproduce the issue on reported chrome version 65.0.3325.181 using Mac 10.13.1 with the below mentioned steps(From comment#10).
1. Launched chrome
2. Navigated to weather.com
3. Inspected the page after it's loading is complete.
3. -> Network tab and saved har file with content
4. Moved to console.
We didn't observe any error in console. Attaching the screen cast of the same.

@Reporter: Could you please have a look at the screen cast and let us know if we have missed anything in the process. Any further inputs from your end may be helpful.

@Eugene Ostroukhov: Could you please let us know if this issue is related to  Issue 817970  and help in triaging it further.

Thanks!
828601.mp4
6.7 MB View Download

Comment 19 Deleted

After an upgrade from 65.0.3325.181 (Official Build) (64-bit) to Chrome 66.0.3359.117 (Official Build) (64-bit) [both Windows 10], the date error seems to have gone - I see no errors in the console.

But sometimes now the HAR saved is corrupted, the data just ends abruptly. Example included.

This doesn't happen consistently.

weather.com.har
9.1 MB Download

Comment 21 Deleted

Delete comment ⚐
Same here, 

After upgrade to chrome66 (MAC), I don't see it happens.

but @vamshi, for your question, I guess you don't have enough requests in your network tab. so maybe open devtools then refresh and wait for a while, so you should see more request. Then do the export har action(chrome 65)

and the error is not in the console, I saw the error in the console of devtools(undock devtools into separate window, target on devtools, then do option+command+j to open devtools of devtools )
Project Member

Comment 23 by bugdroid1@chromium.org, May 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/56b8dabc3fb627039d9babbaa4707e8b038db4bc

commit 56b8dabc3fb627039d9babbaa4707e8b038db4bc
Author: Eugene Ostroukhov <eostroukhov@chromium.org>
Date: Thu May 10 22:21:57 2018

DevTools: use base64 for files with Unicode characters

Bug:  828601 
Change-Id: Ia90474edd65f80e432533974ff12d08c4a149ba8
Reviewed-on: https://chromium-review.googlesource.com/1053060
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Eugene Ostroukhov <eostroukhov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557694}
[modify] https://crrev.com/56b8dabc3fb627039d9babbaa4707e8b038db4bc/third_party/blink/renderer/devtools/front_end/network/HARWriter.js

Labels: -Needs-Triage-M65
Status: Fixed (was: Assigned)
Comment #20 had been fixed.
Labels: TE-Verified-M68 TE-Verified-68.0.3427.0
Verified the fix on Mac 10.13.1 using Chrome version #68.0.3427.0 as per the comment #0.
Attaching screen shot for reference.
Observed that the console didn't show any error message.
Hence, the fix is working as expected. 
Adding the verified labels.
Note: Able to reproduce the issue on chrome version with out fix(Followed the steps mentioned in comment#22).

Thanks...!!
828601 CL Verification.png
1.8 MB View Download
Thanks!
Cc: kouhei@chromium.org ksakamoto@chromium.org kinuko@chromium.org
 Issue 858968  has been merged into this issue.

Sign in to add a comment