@@ -521,11 +521,18 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
521521 private readonly summaryToolbarInternal : UI . Toolbar . Toolbar ;
522522 private readonly filterBar : UI . FilterBar . FilterBar ;
523523 private readonly textFilterSetting : Common . Settings . Setting < string > ;
524+ private readonly isReactNative : boolean = false ;
524525
525526 constructor (
526527 filterBar : UI . FilterBar . FilterBar , progressBarContainer : Element ,
527528 networkLogLargeRowsSetting : Common . Settings . Setting < boolean > ) {
528529 super ( ) ;
530+
531+ // [RN] Used to scope down available features for React Native targets
532+ this . isReactNative = Root . Runtime . experiments . isEnabled (
533+ Root . Runtime . ExperimentName . REACT_NATIVE_SPECIFIC_UI ,
534+ ) ;
535+
529536 this . setMinimumSize ( 50 , 64 ) ;
530537
531538 this . element . id = 'network-container' ;
@@ -599,14 +606,17 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
599606 filterBar . addFilter ( this . invertFilterUI ) ;
600607 filterBar . addDivider ( ) ;
601608
602- const filterItems =
603- Object . entries ( Common . ResourceType . resourceCategories ) . map ( ( [ key , category ] ) => ( {
604- name : category . title ( ) ,
605- label : ( ) => category . shortTitle ( ) ,
606- title : category . title ( ) ,
607- jslogContext :
608- Platform . StringUtilities . toKebabCase ( key ) ,
609- } ) ) ;
609+ const filterItems = Object . entries (
610+ this . isReactNative
611+ ? Common . ResourceType . resourceCategoriesReactNative
612+ : Common . ResourceType . resourceCategories
613+ ) . map ( ( [ key , category ] ) => ( {
614+ name : category . title ( ) ,
615+ label : ( ) => category . shortTitle ( ) ,
616+ title : category . title ( ) ,
617+ jslogContext :
618+ Platform . StringUtilities . toKebabCase ( key ) ,
619+ } ) ) ;
610620
611621 if ( Root . Runtime . experiments . isEnabled ( Root . Runtime . ExperimentName . NETWORK_PANEL_FILTER_BAR_REDESIGN ) ) {
612622 this . resourceCategoryFilterUI = new DropDownTypesUI ( filterItems , this . networkResourceTypeFiltersSetting ) ;
@@ -2873,10 +2883,16 @@ export class MoreFiltersDropDownUI extends
28732883 private activeFiltersCount : HTMLElement ;
28742884 private activeFiltersCountAdorner : Adorners . Adorner . Adorner ;
28752885 private hasChanged = false ;
2886+ private readonly isReactNative : boolean = false ;
28762887
28772888 constructor ( ) {
28782889 super ( ) ;
28792890
2891+ // [RN] Used to disable web-specific filters
2892+ this . isReactNative = Root . Runtime . experiments . isEnabled (
2893+ Root . Runtime . ExperimentName . REACT_NATIVE_SPECIFIC_UI ,
2894+ ) ;
2895+
28802896 this . networkHideDataURLSetting = Common . Settings . Settings . instance ( ) . createSetting ( 'network-hide-data-url' , false ) ;
28812897 this . networkHideChromeExtensionsSetting =
28822898 Common . Settings . Settings . instance ( ) . createSetting ( 'network-hide-chrome-extensions' , false ) ;
@@ -2951,36 +2967,42 @@ export class MoreFiltersDropDownUI extends
29512967 tooltip : i18nString ( UIStrings . hidesDataAndBlobUrls ) ,
29522968 jslogContext : 'hide-data-urls' ,
29532969 } ) ;
2954- this . contextMenu . defaultSection ( ) . appendCheckboxItem (
2955- i18nString ( UIStrings . chromeExtensions ) ,
2956- ( ) => this . networkHideChromeExtensionsSetting . set ( ! this . networkHideChromeExtensionsSetting . get ( ) ) , {
2957- checked : this . networkHideChromeExtensionsSetting . get ( ) ,
2958- tooltip : i18nString ( UIStrings . hideChromeExtension ) ,
2959- jslogContext : 'hide-extension-urls' ,
2960- } ) ;
2961- this . contextMenu . defaultSection ( ) . appendSeparator ( ) ;
2962-
2963- this . contextMenu . defaultSection ( ) . appendCheckboxItem (
2964- i18nString ( UIStrings . hasBlockedCookies ) ,
2965- ( ) => this . networkShowBlockedCookiesOnlySetting . set ( ! this . networkShowBlockedCookiesOnlySetting . get ( ) ) , {
2966- checked : this . networkShowBlockedCookiesOnlySetting . get ( ) ,
2967- tooltip : i18nString ( UIStrings . onlyShowRequestsWithBlockedCookies ) ,
2968- jslogContext : 'only-blocked-response-cookies' ,
2969- } ) ;
2970+ if ( ! this . isReactNative ) {
2971+ this . contextMenu . defaultSection ( ) . appendCheckboxItem (
2972+ i18nString ( UIStrings . chromeExtensions ) ,
2973+ ( ) => this . networkHideChromeExtensionsSetting . set ( ! this . networkHideChromeExtensionsSetting . get ( ) ) , {
2974+ checked : this . networkHideChromeExtensionsSetting . get ( ) ,
2975+ tooltip : i18nString ( UIStrings . hideChromeExtension ) ,
2976+ jslogContext : 'hide-extension-urls' ,
2977+ } ) ;
2978+ this . contextMenu . defaultSection ( ) . appendSeparator ( ) ;
2979+ }
2980+
2981+ if ( ! this . isReactNative ) {
2982+ this . contextMenu . defaultSection ( ) . appendCheckboxItem (
2983+ i18nString ( UIStrings . hasBlockedCookies ) ,
2984+ ( ) => this . networkShowBlockedCookiesOnlySetting . set ( ! this . networkShowBlockedCookiesOnlySetting . get ( ) ) , {
2985+ checked : this . networkShowBlockedCookiesOnlySetting . get ( ) ,
2986+ tooltip : i18nString ( UIStrings . onlyShowRequestsWithBlockedCookies ) ,
2987+ jslogContext : 'only-blocked-response-cookies' ,
2988+ } ) ;
2989+ }
29702990 this . contextMenu . defaultSection ( ) . appendCheckboxItem (
29712991 i18nString ( UIStrings . blockedRequests ) ,
29722992 ( ) => this . networkOnlyBlockedRequestsSetting . set ( ! this . networkOnlyBlockedRequestsSetting . get ( ) ) , {
29732993 checked : this . networkOnlyBlockedRequestsSetting . get ( ) ,
29742994 tooltip : i18nString ( UIStrings . onlyShowBlockedRequests ) ,
29752995 jslogContext : 'only-blocked-requests' ,
29762996 } ) ;
2977- this . contextMenu . defaultSection ( ) . appendCheckboxItem (
2978- i18nString ( UIStrings . thirdParty ) ,
2979- ( ) => this . networkOnlyThirdPartySetting . set ( ! this . networkOnlyThirdPartySetting . get ( ) ) , {
2980- checked : this . networkOnlyThirdPartySetting . get ( ) ,
2981- tooltip : i18nString ( UIStrings . onlyShowThirdPartyRequests ) ,
2982- jslogContext : 'only-3rd-party-requests' ,
2983- } ) ;
2997+ if ( ! this . isReactNative ) {
2998+ this . contextMenu . defaultSection ( ) . appendCheckboxItem (
2999+ i18nString ( UIStrings . thirdParty ) ,
3000+ ( ) => this . networkOnlyThirdPartySetting . set ( ! this . networkOnlyThirdPartySetting . get ( ) ) , {
3001+ checked : this . networkOnlyThirdPartySetting . get ( ) ,
3002+ tooltip : i18nString ( UIStrings . onlyShowThirdPartyRequests ) ,
3003+ jslogContext : 'only-3rd-party-requests' ,
3004+ } ) ;
3005+ }
29843006
29853007 void this . contextMenu . show ( ) ;
29863008 }
0 commit comments