Missing response content from request in chrome.devtools.network.onRequestFinished.addListener

3,246 views
Skip to first unread message

curiousgally

unread,
Jun 17, 2015, 4:51:25 PM6/17/15
to google-chrome-...@googlegroups.com
Hi,

I'm trying to mimic the Network tab in Chrome developer tools panel and wanted to filter network calls in a seperate panel. I'm listening to chrome.devtools.network.onRequestFinished.addListener to filter out the unnecessary calls. However I'm not able to see the response content from the 'req' object in: 

chrome.devtools.network.onRequestFinished.addListener(function(req) {
var url = req.request.url;
var status = req.response.status;

I only see bare minimal fields like status, mime etc  in the response object and no response content. I also tried exporting the HAR from network tab which also has the content missing from response in the export.

Any help is appreciated.

Thanks.

Richard Radics

unread,
Sep 8, 2015, 8:05:51 AM9/8/15
to Google Chrome Developer Tools
Is it any workaround for this issue?

Andrey Kosyakov

unread,
Sep 11, 2015, 2:30:56 PM9/11/15
to Google Chrome Developer Tools
This is actually by design, please note that DevTools API docs state this explicitly:


So the req object you're getting in the listener has the getContent() method you can use to retrieve the content. Similarly, in Network Panel, there's a content menu item "Save as HAR with content" that provides HAR that has content.

Best regards,
Andrey.

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/ebf7dd85-3f5d-422e-bc30-142ff79c3fcc%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages