I listen for Network.responseReceived events and follow up with Network.getResponseBody. Usually the response body comes back fine no problem. However, if the response is a downloaded file as opposed to some resource loaded into the dom, it seems getResponseBody returns an error, 'No data found for resource with given identifier'. I'm not sure if this is intentional or not. Has anyone else ran into this or successfully gotten the response body of a downloaded file through the API? Just to be clear, this file shows up in the download bar at the bottom of Google Chrome. It does not show up in the Network tab in the inspector, but there are still the usual Network events fired for the file.
{"method":"Network.getResponseBody","params":{"requestId":"26994.2"},"id":17}
Network.getResponseBody: {"error":{"code":-32000,"message":"No data found for resource with given identifier"},"id":17}
That call and response both follow these two usual events which precede a working getResponseBody invocation:
{
"method": "Network.requestWillBeSent",
"params": {
"requestId": "26994.2",
"loaderId": "26994.2",
"request": {
...
"type": "Document",
"frameId": "26994.1"
}
},
{
"method": "Network.responseReceived",
"params": {
"requestId": "26994.2",
"loaderId": "26994.2",
"timestamp": 1395971.150643,
"type": "Document",
"response": {
"status": 200,
"statusText": "OK",
...
"frameId": "26994.1"
}
}