()
| 278 | } |
| 279 | |
| 280 | function createProfilerPanel() { |
| 281 | if (profilerPortalContainer) { |
| 282 | // Panel is created and user opened it at least once |
| 283 | ensureInitialHTMLIsCleared(profilerPortalContainer); |
| 284 | render('profiler'); |
| 285 | |
| 286 | return; |
| 287 | } |
| 288 | |
| 289 | if (profilerPanel) { |
| 290 | // Panel is created, but wasn't opened yet, so no document is present for it |
| 291 | return; |
| 292 | } |
| 293 | |
| 294 | chrome.devtools.panels.create( |
| 295 | __IS_CHROME__ || __IS_EDGE__ ? 'Profiler ⚛' : 'Profiler', |
| 296 | __IS_EDGE__ ? 'icons/production.svg' : '', |
| 297 | 'panel.html', |
| 298 | createdPanel => { |
| 299 | profilerPanel = createdPanel; |
| 300 | |
| 301 | createdPanel.onShown.addListener(portal => { |
| 302 | profilerPortalContainer = portal.container; |
| 303 | if (profilerPortalContainer != null && render) { |
| 304 | ensureInitialHTMLIsCleared(profilerPortalContainer); |
| 305 | |
| 306 | render('profiler'); |
| 307 | portal.injectStyles(cloneStyleTags); |
| 308 | |
| 309 | logEvent({event_name: 'selected-profiler-tab'}); |
| 310 | } |
| 311 | }); |
| 312 | }, |
| 313 | ); |
| 314 | } |
| 315 | |
| 316 | function createSourcesEditorPanel() { |
| 317 | if (editorPortalContainer) { |
no test coverage detected