@@ -24,7 +24,7 @@ import type {ImageContentData, Response} from './tools/ToolDefinition.js';
2424import { paginate , type PaginationOptions } from './utils/pagination.js' ;
2525
2626interface NetworkRequestData {
27- networkRequestUrl : string ;
27+ networkRequestStableId : number ;
2828 requestBody ?: string ;
2929 responseBody ?: string ;
3030}
@@ -81,9 +81,9 @@ export class McpResponse implements Response {
8181 this . #includeConsoleData = value ;
8282 }
8383
84- attachNetworkRequest ( url : string ) : void {
84+ attachNetworkRequest ( reqid : number ) : void {
8585 this . #attachedNetworkRequestData = {
86- networkRequestUrl : url ,
86+ networkRequestStableId : reqid ,
8787 } ;
8888 }
8989
@@ -98,8 +98,8 @@ export class McpResponse implements Response {
9898 get includeConsoleData ( ) : boolean {
9999 return this . #includeConsoleData;
100100 }
101- get attachedNetworkRequestUrl ( ) : string | undefined {
102- return this . #attachedNetworkRequestData?. networkRequestUrl ;
101+ get attachedNetworkRequestId ( ) : number | undefined {
102+ return this . #attachedNetworkRequestData?. networkRequestStableId ;
103103 }
104104 get networkRequestsPageIdx ( ) : number | undefined {
105105 return this . #networkRequestsOptions?. pagination ?. pageIdx ;
@@ -138,9 +138,9 @@ export class McpResponse implements Response {
138138
139139 let formattedConsoleMessages : string [ ] ;
140140
141- if ( this . #attachedNetworkRequestData?. networkRequestUrl ) {
142- const request = context . getNetworkRequestByUrl (
143- this . #attachedNetworkRequestData. networkRequestUrl ,
141+ if ( this . #attachedNetworkRequestData?. networkRequestStableId ) {
142+ const request = context . getNetworkRequestById (
143+ this . #attachedNetworkRequestData. networkRequestStableId ,
144144 ) ;
145145
146146 this . #attachedNetworkRequestData. requestBody =
@@ -309,12 +309,12 @@ Call ${handleDialog.name} to handle it before continuing.`);
309309
310310 #getIncludeNetworkRequestsData( context : McpContext ) : string [ ] {
311311 const response : string [ ] = [ ] ;
312- const url = this . #attachedNetworkRequestData?. networkRequestUrl ;
312+ const url = this . #attachedNetworkRequestData?. networkRequestStableId ;
313313 if ( ! url ) {
314314 return response ;
315315 }
316316
317- const httpRequest = context . getNetworkRequestByUrl ( url ) ;
317+ const httpRequest = context . getNetworkRequestById ( url ) ;
318318 response . push ( `## Request ${ httpRequest . url ( ) } ` ) ;
319319 response . push ( `Status: ${ getStatusFromRequest ( httpRequest ) } ` ) ;
320320 response . push ( `### Request Headers` ) ;
0 commit comments