← Back to Network domain

Network.emulateNetworkConditions

Activates emulation of network conditions. This command is deprecated in favor of the emulateNetworkConditionsByRule and overrideNetworkState commands, which can be used together to the same effect.

Domain: Network deprecated

Parameters

NameTypeDescription
offlinebooleanTrue to emulate internet disconnection.
latencynumberMinimum latency from request sent to response headers received (ms).
downloadThroughputnumberMaximal aggregated download throughput (bytes/sec). -1 disables download throttling.
uploadThroughputnumberMaximal aggregated upload throughput (bytes/sec). -1 disables upload throttling.
connectionType (optional)ConnectionTypeConnection type if known.
packetLoss (optional)numberWebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
packetQueueLength (optional)integerWebRTC packet queue length (packet). 0 removes any queue length limitations.
packetReordering (optional)booleanWebRTC packetReordering feature.

Example Request

{
  "id": 1,
  "method": "Network.emulateNetworkConditions",
  "params": {
    "offline": true,
    "latency": 1.0,
    "downloadThroughput": 1.0,
    "uploadThroughput": 1.0
  }
}

Example Response

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

Usage in Node.js

const result = await send('Network.emulateNetworkConditions', {"offline": true, "latency": 1.0, "downloadThroughput": 1.0, "uploadThroughput": 1.0});
console.log(result);