← Back to Network domain

Network.enable

Enables network tracking, network events will now be delivered to the client.

Domain: Network stable

Parameters

NameTypeDescription
maxTotalBufferSize (optional)integerBuffer size in bytes to use when preserving network payloads (XHRs, etc). This is the maximum number of bytes that will be collected by this DevTools session.
maxResourceBufferSize (optional)integerPer-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
maxPostDataSize (optional)integerLongest post body size (in bytes) that would be included in requestWillBeSent notification
reportDirectSocketTraffic (optional)booleanWhether DirectSocket chunk send/receive events should be reported.
enableDurableMessages (optional)booleanEnable storing response bodies outside of renderer, so that these survive a cross-process navigation. Requires maxTotalBufferSize to be set. Currently defaults to false. This field is being deprecated in favor of the dedicated configureDurableMessages command, due to the possibility of deadlocks when awaiting Network.enable before issuing Runtime.runIfWaitingForDebugger.

Example Request

{
  "id": 1,
  "method": "Network.enable"
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('Network.enable');
console.log(result);