@@ -19,9 +19,10 @@ import type {
1919} from 'react-devtools-shared/src/frontend/types' ;
2020import type { FrontendBridge } from 'react-devtools-shared/src/bridge' ;
2121import type {
22+ CanViewElementSource ,
23+ TabID ,
2224 ViewAttributeSource ,
2325 ViewElementSource ,
24- CanViewElementSource ,
2526} from 'react-devtools-shared/src/devtools/views/DevTools' ;
2627import type { Config } from 'react-devtools-shared/src/devtools/store' ;
2728
@@ -51,10 +52,11 @@ type InitializationOptions = {
5152 canViewElementSourceFunction ?: CanViewElementSource ,
5253} ;
5354
54- export function initialize (
55+ function initializeTab (
56+ tab : TabID ,
5557 contentWindow : Element | Document ,
5658 options : InitializationOptions ,
57- ) : void {
59+ ) {
5860 const {
5961 bridge,
6062 store,
@@ -70,7 +72,8 @@ export function initialize(
7072 bridge = { bridge }
7173 browserTheme = { theme }
7274 store = { store }
73- showTabBar = { true }
75+ showTabBar = { false }
76+ overrideTab = { tab }
7477 warnIfLegacyBackendDetected = { true }
7578 enabledInspectedElementContextMenu = { true }
7679 viewAttributeSourceFunction = { viewAttributeSourceFunction }
@@ -79,3 +82,17 @@ export function initialize(
7982 /> ,
8083 ) ;
8184}
85+
86+ export function initializeComponents (
87+ contentWindow : Element | Document ,
88+ options : InitializationOptions ,
89+ ) : void {
90+ initializeTab ( 'components' , contentWindow , options ) ;
91+ }
92+
93+ export function initializeProfiler (
94+ contentWindow : Element | Document ,
95+ options : InitializationOptions ,
96+ ) : void {
97+ initializeTab ( 'profiler' , contentWindow , options ) ;
98+ }
0 commit comments