Network.overrideNetworkStateOverride the state of navigator.onLine and navigator.connection.
| Name | Type | Description |
|---|---|---|
offline | boolean | True to emulate internet disconnection. |
latency | number | Minimum latency from request sent to response headers received (ms). |
downloadThroughput | number | Maximal aggregated download throughput (bytes/sec). -1 disables download throttling. |
uploadThroughput | number | Maximal aggregated upload throughput (bytes/sec). -1 disables upload throttling. |
connectionType (optional) | ConnectionType | Connection type if known. |
{
"id": 1,
"method": "Network.overrideNetworkState",
"params": {
"offline": true,
"latency": 1.0,
"downloadThroughput": 1.0,
"uploadThroughput": 1.0
}
}
{
"id": 1,
"result": {}
}
const result = await send('Network.overrideNetworkState', {"offline": true, "latency": 1.0, "downloadThroughput": 1.0, "uploadThroughput": 1.0});
console.log(result);