diff --git a/package.json b/package.json index ca0ec7214..0e1789e58 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "autoprefixer": "^9.7.4", "babel-eslint": "^10.1.0", "babel-loader": "^8.2.5", - "chobitsu": "^1.8.1", + "chobitsu": "^1.8.4", "core-js": "^3.37.1", "css-loader": "^3.4.2", "es-check": "^6.2.1", diff --git a/src/Network/Network.js b/src/Network/Network.js index 3da476051..945dc9cb6 100644 --- a/src/Network/Network.js +++ b/src/Network/Network.js @@ -203,6 +203,22 @@ export default class Network extends Tool { request.render() } + _loadingFailed = (params) => { + const request = this._requests[params.requestId] + if (!this._isRecording || !request) { + return + } + + const time = params.timestamp * 1000 + request.time = time - request.startTime + request.displayTime = ms(request.time) + + request.hasErr = true + request.status = 0 + request.done = true + + request.render() + } _copyCurl = () => { const request = this._selectedRequest @@ -322,6 +338,7 @@ export default class Network extends Tool { network.on('responseReceivedExtraInfo', this._resReceivedExtraInfo) network.on('responseReceived', this._resReceived) network.on('loadingFinished', this._loadingFinished) + network.on('loadingFailed', this._loadingFailed) emitter.on(emitter.SCALE, this._updateScale) }