File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
src/bidiMapper/modules/network Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ export class NetworkRequest {
6565
6666 #fetchId?: Protocol . Fetch . RequestId ;
6767
68+ #finished = false ;
69+
6870 /**
6971 * Indicates the network intercept phase, if the request is currently blocked.
7072 * Undefined necessarily implies that the request is not blocked.
@@ -473,7 +475,8 @@ export class NetworkRequest {
473475 if (
474476 Boolean ( this . #response. info ) &&
475477 responseExtraInfoCompleted &&
476- responseInterceptionCompleted
478+ responseInterceptionCompleted &&
479+ this . #finished
477480 ) {
478481 this . #emitEvent( this . #getResponseReceivedEvent. bind ( this ) ) ;
479482 this . #networkStorage. disposeRequest ( this . id ) ;
@@ -523,6 +526,7 @@ export class NetworkRequest {
523526 }
524527
525528 onLoadingFailedEvent ( event : Protocol . Network . LoadingFailedEvent ) {
529+ this . #finished = true ;
526530 this . #emitEventsIfReady( {
527531 hasFailed : true ,
528532 } ) ;
@@ -1100,6 +1104,11 @@ export class NetworkRequest {
11001104 return 'other' ;
11011105 }
11021106 }
1107+
1108+ onLoadingFinished ( ) : void {
1109+ this . #finished = true ;
1110+ this . #emitEventsIfReady( ) ;
1111+ }
11031112}
11041113
11051114function getCdpBodyFromBiDiBytesValue (
Original file line number Diff line number Diff line change @@ -161,6 +161,15 @@ export class NetworkStorage {
161161 ) . onResponseReceivedExtraInfoEvent ( params ) ;
162162 } ,
163163 ] ,
164+ [
165+ 'Network.loadingFinished' ,
166+ ( params : Protocol . Network . LoadingFinishedEvent ) => {
167+ this . #getOrCreateNetworkRequest(
168+ params . requestId ,
169+ cdpTarget ,
170+ ) . onLoadingFinished ( ) ;
171+ } ,
172+ ] ,
164173 [
165174 'Network.requestServedFromCache' ,
166175 ( params : Protocol . Network . RequestServedFromCacheEvent ) => {
You can’t perform that action at this time.
0 commit comments