@@ -7,6 +7,7 @@ import '../../../ui/components/request_link_icon/request_link_icon.js';
77import * as i18n from '../../../core/i18n/i18n.js' ;
88import * as Platform from '../../../core/platform/platform.js' ;
99import type * as SDK from '../../../core/sdk/sdk.js' ;
10+ import * as Helpers from '../../../models/trace/helpers/helpers.js' ;
1011import * as Trace from '../../../models/trace/trace.js' ;
1112import type * as RequestLinkIcon from '../../../ui/components/request_link_icon/request_link_icon.js' ;
1213import * as PerfUI from '../../../ui/legacy/components/perf_ui/perf_ui.js' ;
@@ -107,6 +108,18 @@ const UIStrings = {
107108 *@description Text that refers to the waiting on main thread time of a network request
108109 */
109110 waitingOnMainThread : 'Waiting on main thread' ,
111+ /**
112+ *@description Text that refers to if the network request is blocking
113+ */
114+ blocking : 'Blocking' ,
115+ /**
116+ *@description Text that refers to if the network request is in-body parser render blocking
117+ */
118+ inBodyParserBlocking : 'In-body parser blocking' ,
119+ /**
120+ *@description Text that refers to if the network request is render blocking
121+ */
122+ renderBlocking : 'Render blocking' ,
110123} ;
111124const str_ = i18n . i18n . registerUIStrings ( 'panels/timeline/components/NetworkRequestDetails.ts' , UIStrings ) ;
112125const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
@@ -295,6 +308,26 @@ export class NetworkRequestDetails extends HTMLElement {
295308 return null ;
296309 }
297310
311+ #renderBlockingRow( ) : LitHtml . TemplateResult | null {
312+ if ( ! this . #networkRequest || ! Helpers . Network . isSyntheticNetworkRequestEventRenderBlocking ( this . #networkRequest) ) {
313+ return null ;
314+ }
315+
316+ let renderBlockingText ;
317+ switch ( this . #networkRequest. args . data . renderBlocking ) {
318+ case 'blocking' :
319+ renderBlockingText = UIStrings . renderBlocking ;
320+ break ;
321+ case 'in_body_parser_blocking' :
322+ renderBlockingText = UIStrings . inBodyParserBlocking ;
323+ break ;
324+ default :
325+ // Shouldn't fall to this block, if so, this network request is not render blocking, so return null.
326+ return null ;
327+ }
328+ return this . #renderRow( i18nString ( UIStrings . blocking ) , renderBlockingText ) ;
329+ }
330+
298331 async #renderPreviewElement( ) : Promise < LitHtml . TemplateResult | null > {
299332 if ( ! this . #networkRequest) {
300333 return null ;
@@ -400,6 +433,7 @@ export class NetworkRequestDetails extends HTMLElement {
400433 ${ this . #renderEncodedDataLength( ) }
401434 ${ this . #renderRow( i18nString ( UIStrings . decodedBody ) , Platform . NumberUtilities . bytesToString ( this . #networkRequest. args . data . decodedBodyLength ) ) }
402435 ${ this . #renderInitiatedBy( ) }
436+ ${ this . #renderBlockingRow( ) }
403437 ${ await this . #renderPreviewElement( ) }
404438 </ div >
405439 < div class ="network-request-details-col ">
0 commit comments