( tab: TabID, contentWindow: Element | Document, options: InitializationOptions, )
| 55 | }; |
| 56 | |
| 57 | function initializeTab( |
| 58 | tab: TabID, |
| 59 | contentWindow: Element | Document, |
| 60 | options: InitializationOptions, |
| 61 | ) { |
| 62 | const { |
| 63 | bridge, |
| 64 | store, |
| 65 | theme = 'light', |
| 66 | viewAttributeSourceFunction, |
| 67 | viewElementSourceFunction, |
| 68 | canViewElementSourceFunction, |
| 69 | fetchFileWithCaching, |
| 70 | } = options; |
| 71 | const root = createRoot(contentWindow); |
| 72 | |
| 73 | root.render( |
| 74 | <DevTools |
| 75 | bridge={bridge} |
| 76 | browserTheme={theme} |
| 77 | store={store} |
| 78 | showTabBar={false} |
| 79 | overrideTab={tab} |
| 80 | warnIfLegacyBackendDetected={true} |
| 81 | enabledInspectedElementContextMenu={true} |
| 82 | viewAttributeSourceFunction={viewAttributeSourceFunction} |
| 83 | viewElementSourceFunction={viewElementSourceFunction} |
| 84 | canViewElementSourceFunction={canViewElementSourceFunction} |
| 85 | fetchFileWithCaching={fetchFileWithCaching} |
| 86 | />, |
| 87 | ); |
| 88 | } |
| 89 | |
| 90 | export function initializeComponents( |
| 91 | contentWindow: Element | Document, |
| 92 | options: InitializationOptions, |
| 93 | ): void { |
| 94 | initializeTab('components', contentWindow, options); |
| 95 | } |
| 96 | |
| 97 | export function initializeProfiler( |
| 98 | contentWindow: Element | Document, |
| 99 | options: InitializationOptions, |
| 100 | ): void { |
| 101 | initializeTab('profiler', contentWindow, options); |
| 102 | } |
nothing calls this directly
no test coverage detected