chrome-devtools-frontend 1.0.1526630 → 1.0.1529186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/ui_engineering.md +159 -0
- package/eslint.config.mjs +6 -1
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/i18nImpl.ts +6 -1
- package/front_end/core/protocol_client/protocol_client.ts +1 -1
- package/front_end/core/root/Runtime.ts +38 -4
- package/front_end/core/sdk/CSSMatchedStyles.ts +50 -7
- package/front_end/core/sdk/CSSRule.ts +35 -6
- package/front_end/core/sdk/Connections.ts +2 -1
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/DebuggerModel.ts +5 -1
- package/front_end/core/sdk/NetworkManager.ts +267 -34
- package/front_end/core/sdk/PreloadingModel.ts +82 -17
- package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1 -1
- package/front_end/core/sdk/RehydratingConnection.ts +29 -4
- package/front_end/core/sdk/ScopeTreeCache.ts +8 -3
- package/front_end/core/sdk/SourceMap.ts +41 -11
- package/front_end/core/sdk/SourceMapManager.ts +13 -2
- package/front_end/core/sdk/SourceMapScopesInfo.ts +49 -2
- package/front_end/core/sdk/TargetManager.ts +0 -22
- package/front_end/core/sdk/TraceObject.ts +8 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +81 -0
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +3 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +1 -0
- package/front_end/entrypoints/main/MainImpl.ts +42 -28
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +2 -0
- package/front_end/generated/protocol.ts +17 -3
- package/front_end/models/ai_assistance/BuiltInAi.ts +111 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +15 -14
- package/front_end/models/ai_assistance/ai_assistance.ts +53 -24
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +105 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +6 -1
- package/front_end/models/extensions/ExtensionView.ts +3 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +31 -27
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +31 -29
- package/front_end/models/persistence/NetworkPersistenceManager.ts +3 -5
- package/front_end/models/persistence/PersistenceImpl.ts +0 -5
- package/front_end/models/persistence/persistence-meta.ts +0 -31
- package/front_end/models/persistence/persistence.ts +0 -6
- package/front_end/models/source_map_scopes/NamesResolver.ts +5 -11
- package/front_end/models/stack_trace/Trie.ts +9 -0
- package/front_end/models/trace/lantern/types/Lantern.ts +1 -1
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +1 -0
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +1 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +120 -113
- package/front_end/panels/ai_assistance/PatchWidget.ts +9 -8
- package/front_end/panels/ai_assistance/SelectWorkspaceDialog.ts +2 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +29 -29
- package/front_end/panels/ai_assistance/components/UserActionRow.ts +1 -0
- package/front_end/panels/animation/AnimationTimeline.ts +1 -0
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/KeyValueStorageItemsView.ts +1 -0
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +2 -0
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +11 -5
- package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +2 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -5
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +22 -10
- package/front_end/panels/changes/CombinedDiffView.ts +1 -0
- package/front_end/{models/persistence → panels/common}/PersistenceUtils.ts +15 -17
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +369 -0
- package/front_end/panels/console/ConsolePanel.ts +2 -0
- package/front_end/panels/console/ConsolePrompt.ts +12 -2
- package/front_end/panels/console/ConsoleSidebar.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +12 -0
- package/front_end/panels/console/ConsoleViewMessage.ts +44 -0
- package/front_end/panels/{explain → console}/PromptBuilder.ts +12 -7
- package/front_end/panels/console/console-meta.ts +14 -0
- package/front_end/panels/console/console.ts +6 -0
- package/front_end/panels/console/consoleInsightTeaser.css +83 -0
- package/front_end/panels/coverage/CoverageListView.ts +29 -11
- package/front_end/panels/coverage/CoverageView.ts +292 -284
- package/front_end/panels/coverage/coverageView.css +17 -0
- package/front_end/panels/elements/ComputedStyleWidget.ts +1 -0
- package/front_end/panels/elements/LayoutPane.ts +1 -0
- package/front_end/panels/elements/NodeStackTraceWidget.ts +1 -0
- package/front_end/panels/elements/StylePropertyTreeElement.ts +5 -1
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +17 -0
- package/front_end/panels/emulation/DeviceModeView.ts +2 -0
- package/front_end/panels/explain/ActionDelegate.ts +4 -2
- package/front_end/panels/explain/components/ConsoleInsight.ts +14 -12
- package/front_end/panels/explain/explain-meta.ts +7 -0
- package/front_end/panels/explain/explain.ts +0 -1
- package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -1
- package/front_end/panels/layer_viewer/Layers3DView.ts +2 -0
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -0
- package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +1 -0
- package/front_end/panels/media/MainView.ts +1 -0
- package/front_end/panels/media/TickingFlameChart.ts +2 -0
- package/front_end/panels/network/BlockedURLsPane.ts +237 -108
- package/front_end/panels/network/EventSourceMessagesView.ts +1 -0
- package/front_end/panels/network/NetworkItemView.ts +1 -0
- package/front_end/panels/network/NetworkLogView.ts +9 -7
- package/front_end/panels/network/NetworkOverview.ts +1 -0
- package/front_end/panels/network/RequestCookiesView.ts +1 -0
- package/front_end/panels/network/RequestHTMLView.ts +1 -0
- package/front_end/panels/network/RequestInitiatorView.ts +1 -0
- package/front_end/panels/network/RequestPayloadView.ts +1 -0
- package/front_end/panels/network/RequestPreviewView.ts +1 -0
- package/front_end/panels/network/RequestResponseView.ts +1 -0
- package/front_end/panels/network/RequestTimingView.ts +2 -0
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +1 -0
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +1 -0
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -0
- package/front_end/panels/network/components/RequestTrustTokensView.ts +2 -0
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +7 -0
- package/front_end/panels/profiler/IsolateSelector.ts +1 -0
- package/front_end/panels/profiler/LiveHeapProfileView.ts +1 -0
- package/front_end/panels/profiler/ProfileView.ts +1 -0
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +1 -0
- package/front_end/panels/recorder/RecorderPanel.ts +2 -0
- package/front_end/panels/screencast/ScreencastView.ts +1 -0
- package/front_end/panels/search/SearchView.ts +1 -0
- package/front_end/panels/settings/AISettingsTab.ts +3 -3
- package/front_end/{models/persistence → panels/settings}/EditFileSystemView.ts +3 -6
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +4 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +2 -2
- package/front_end/panels/settings/settings.ts +2 -0
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +12 -0
- package/front_end/panels/sources/BreakpointsView.ts +1 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -0
- package/front_end/{models/persistence → panels/sources}/PersistenceActions.ts +8 -12
- package/front_end/panels/sources/TabbedEditorContainer.ts +2 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +17 -2
- package/front_end/panels/sources/sources-meta.ts +15 -0
- package/front_end/panels/sources/sources.ts +2 -0
- package/front_end/panels/timeline/README.md +2 -2
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +1 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +4 -3
- package/front_end/panels/timeline/TimelineLayersView.ts +1 -0
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +114 -37
- package/front_end/panels/timeline/TimelinePanel.ts +43 -62
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
- package/front_end/panels/timeline/components/LiveMetricsView.ts +4 -8
- package/front_end/panels/timeline/components/Sidebar.ts +2 -0
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +7 -7
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +4 -4
- package/front_end/panels/utils/utils.ts +2 -1
- package/front_end/panels/web_audio/WebAudioView.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/diff/diff_match_patch.js +1 -1
- package/front_end/third_party/lighthouse/README.chromium +2 -2
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1530 -2426
- package/front_end/third_party/lighthouse/locales/ar-XB.json +107 -455
- package/front_end/third_party/lighthouse/locales/ar.json +107 -455
- package/front_end/third_party/lighthouse/locales/bg.json +96 -444
- package/front_end/third_party/lighthouse/locales/ca.json +96 -444
- package/front_end/third_party/lighthouse/locales/cs.json +96 -444
- package/front_end/third_party/lighthouse/locales/da.json +96 -444
- package/front_end/third_party/lighthouse/locales/de.json +96 -444
- package/front_end/third_party/lighthouse/locales/el.json +96 -444
- package/front_end/third_party/lighthouse/locales/en-GB.json +96 -444
- package/front_end/third_party/lighthouse/locales/en-US.json +116 -467
- package/front_end/third_party/lighthouse/locales/en-XA.json +93 -441
- package/front_end/third_party/lighthouse/locales/en-XL.json +116 -467
- package/front_end/third_party/lighthouse/locales/es-419.json +96 -444
- package/front_end/third_party/lighthouse/locales/es.json +96 -444
- package/front_end/third_party/lighthouse/locales/fi.json +96 -444
- package/front_end/third_party/lighthouse/locales/fil.json +96 -444
- package/front_end/third_party/lighthouse/locales/fr.json +96 -444
- package/front_end/third_party/lighthouse/locales/he.json +118 -466
- package/front_end/third_party/lighthouse/locales/hi.json +96 -444
- package/front_end/third_party/lighthouse/locales/hr.json +100 -448
- package/front_end/third_party/lighthouse/locales/hu.json +96 -444
- package/front_end/third_party/lighthouse/locales/id.json +96 -444
- package/front_end/third_party/lighthouse/locales/it.json +96 -444
- package/front_end/third_party/lighthouse/locales/ja.json +96 -444
- package/front_end/third_party/lighthouse/locales/ko.json +97 -445
- package/front_end/third_party/lighthouse/locales/lt.json +96 -444
- package/front_end/third_party/lighthouse/locales/lv.json +97 -445
- package/front_end/third_party/lighthouse/locales/nl.json +96 -444
- package/front_end/third_party/lighthouse/locales/no.json +96 -444
- package/front_end/third_party/lighthouse/locales/pl.json +96 -444
- package/front_end/third_party/lighthouse/locales/pt-PT.json +96 -444
- package/front_end/third_party/lighthouse/locales/pt.json +97 -445
- package/front_end/third_party/lighthouse/locales/ro.json +97 -445
- package/front_end/third_party/lighthouse/locales/ru.json +96 -444
- package/front_end/third_party/lighthouse/locales/sk.json +96 -444
- package/front_end/third_party/lighthouse/locales/sl.json +96 -444
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +96 -444
- package/front_end/third_party/lighthouse/locales/sr.json +96 -444
- package/front_end/third_party/lighthouse/locales/sv.json +96 -444
- package/front_end/third_party/lighthouse/locales/ta.json +96 -444
- package/front_end/third_party/lighthouse/locales/te.json +97 -445
- package/front_end/third_party/lighthouse/locales/th.json +96 -444
- package/front_end/third_party/lighthouse/locales/tr.json +96 -444
- package/front_end/third_party/lighthouse/locales/uk.json +96 -444
- package/front_end/third_party/lighthouse/locales/vi.json +96 -444
- package/front_end/third_party/lighthouse/locales/zh-HK.json +96 -444
- package/front_end/third_party/lighthouse/locales/zh-TW.json +97 -445
- package/front_end/third_party/lighthouse/locales/zh.json +96 -444
- package/front_end/third_party/lighthouse/report/bundle.d.ts +8 -14
- package/front_end/third_party/lighthouse/report/bundle.js +10 -49
- package/front_end/third_party/lighthouse/report-assets/report-generator.mjs +1 -1
- package/front_end/third_party/web-vitals/README.chromium +5 -8
- package/front_end/third_party/web-vitals/package/README.md +191 -152
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/index.js +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onCLS.js +45 -26
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFCP.js +3 -3
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.d.ts +10 -10
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +307 -206
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onLCP.js +69 -49
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.d.ts +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onTTFB.js +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/index.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/index.js +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.d.ts +33 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/InteractionManager.js +111 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LCPEntryManager.d.ts +4 -0
- package/front_end/third_party/web-vitals/package/dist/modules/{attribution/deprecated.js → lib/LCPEntryManager.js} +6 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.d.ts +6 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/LayoutShiftManager.js +44 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/bindReporter.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/generateUniqueID.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getActivationStart.js +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getNavigationEntry.js +5 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.d.ts +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getSelector.js +9 -12
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.d.ts +1 -0
- package/front_end/third_party/web-vitals/package/dist/modules/lib/getVisibilityWatcher.js +52 -33
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.d.ts +0 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initMetric.js +2 -2
- package/front_end/third_party/web-vitals/package/dist/modules/lib/initUnique.d.ts +6 -0
- package/front_end/third_party/web-vitals/package/dist/modules/{deprecated.js → lib/initUnique.js} +11 -4
- package/front_end/third_party/web-vitals/package/dist/modules/lib/observe.js +3 -6
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/interactionCountPolyfill.js +6 -6
- package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.d.ts → whenIdleOrHidden.d.ts} +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/{whenIdle.js → whenIdleOrHidden.js} +10 -8
- package/front_end/third_party/web-vitals/package/dist/modules/onCLS.js +17 -35
- package/front_end/third_party/web-vitals/package/dist/modules/onFCP.js +3 -5
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.d.ts +9 -7
- package/front_end/third_party/web-vitals/package/dist/modules/onINP.js +27 -19
- package/front_end/third_party/web-vitals/package/dist/modules/onLCP.js +33 -26
- package/front_end/third_party/web-vitals/package/dist/modules/onTTFB.js +2 -4
- package/front_end/third_party/web-vitals/package/dist/modules/types/base.d.ts +6 -5
- package/front_end/third_party/web-vitals/package/dist/modules/types/cls.d.ts +5 -3
- package/front_end/third_party/web-vitals/package/dist/modules/types/inp.d.ts +80 -33
- package/front_end/third_party/web-vitals/package/dist/modules/types/lcp.d.ts +6 -2
- package/front_end/third_party/web-vitals/package/dist/modules/types.d.ts +28 -4
- package/front_end/third_party/web-vitals/package/dist/modules/types.js +0 -1
- package/front_end/third_party/web-vitals/package/package.json +4 -10
- package/front_end/third_party/web-vitals/package/src/attribution/index.ts +0 -1
- package/front_end/third_party/web-vitals/package/src/attribution/onCLS.ts +58 -33
- package/front_end/third_party/web-vitals/package/src/attribution/onFCP.ts +4 -4
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +382 -258
- package/front_end/third_party/web-vitals/package/src/attribution/onLCP.ts +96 -69
- package/front_end/third_party/web-vitals/package/src/attribution/onTTFB.ts +3 -3
- package/front_end/third_party/web-vitals/package/src/index.ts +0 -1
- package/front_end/third_party/web-vitals/package/src/lib/InteractionManager.ts +146 -0
- package/front_end/third_party/web-vitals/package/src/{attribution/deprecated.ts → lib/LCPEntryManager.ts} +6 -9
- package/front_end/third_party/web-vitals/package/src/lib/LayoutShiftManager.ts +50 -0
- package/front_end/third_party/web-vitals/package/src/lib/bindReporter.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/generateUniqueID.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getActivationStart.ts +1 -1
- package/front_end/third_party/web-vitals/package/src/lib/getNavigationEntry.ts +5 -8
- package/front_end/third_party/web-vitals/package/src/lib/getSelector.ts +12 -12
- package/front_end/third_party/web-vitals/package/src/lib/getVisibilityWatcher.ts +57 -35
- package/front_end/third_party/web-vitals/package/src/lib/initMetric.ts +2 -2
- package/front_end/third_party/web-vitals/package/src/{deprecated.ts → lib/initUnique.ts} +14 -8
- package/front_end/third_party/web-vitals/package/src/lib/observe.ts +3 -11
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/interactionCountPolyfill.ts +12 -6
- package/front_end/third_party/web-vitals/package/src/lib/{whenIdle.ts → whenIdleOrHidden.ts} +10 -8
- package/front_end/third_party/web-vitals/package/src/onCLS.ts +17 -38
- package/front_end/third_party/web-vitals/package/src/onFCP.ts +3 -6
- package/front_end/third_party/web-vitals/package/src/onINP.ts +33 -28
- package/front_end/third_party/web-vitals/package/src/onLCP.ts +36 -29
- package/front_end/third_party/web-vitals/package/src/onTTFB.ts +2 -5
- package/front_end/third_party/web-vitals/package/src/types/base.ts +5 -5
- package/front_end/third_party/web-vitals/package/src/types/cls.ts +5 -3
- package/front_end/third_party/web-vitals/package/src/types/inp.ts +88 -33
- package/front_end/third_party/web-vitals/package/src/types/lcp.ts +6 -2
- package/front_end/third_party/web-vitals/package/src/types.ts +47 -4
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +75 -0
- package/front_end/third_party/web-vitals/rebuild.sh +32 -18
- package/front_end/third_party/web-vitals/web-vitals-tsconfig.json +5 -10
- package/front_end/third_party/web-vitals/web-vitals.ts +0 -2
- package/front_end/ui/components/docs/console_insight/basic.ts +3 -2
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +2 -0
- package/front_end/ui/components/text_editor/TextEditor.ts +0 -2
- package/front_end/ui/legacy/InspectorView.ts +2 -0
- package/front_end/ui/legacy/ListWidget.ts +2 -2
- package/front_end/ui/legacy/SplitWidget.ts +2 -0
- package/front_end/ui/legacy/TabbedPane.ts +1 -0
- package/front_end/ui/legacy/TargetCrashedScreen.ts +1 -0
- package/front_end/ui/legacy/UIUtils.ts +8 -19
- package/front_end/ui/legacy/ViewManager.ts +1 -0
- package/front_end/ui/legacy/components/color_picker/FormatPickerContextMenu.ts +7 -20
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +1 -0
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +1 -0
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/StreamingContentHexView.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +25 -0
- package/mcp/README.md +7 -0
- package/mcp/mcp.ts +8 -0
- package/package.json +1 -1
- package/front_end/models/live-metrics/web-vitals-injected/OnEachInteraction.ts +0 -34
- package/front_end/third_party/web-vitals/package/attribution.d.ts +0 -16
- package/front_end/third_party/web-vitals/package/attribution.js +0 -18
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/deprecated.d.ts +0 -7
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.d.ts +0 -11
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onFID.js +0 -46
- package/front_end/third_party/web-vitals/package/dist/modules/deprecated.d.ts +0 -5
- package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.d.ts +0 -31
- package/front_end/third_party/web-vitals/package/dist/modules/lib/interactions.js +0 -107
- package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/onHidden.js +0 -22
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.d.ts +0 -7
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/firstInputPolyfill.js +0 -147
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.d.ts +0 -1
- package/front_end/third_party/web-vitals/package/dist/modules/lib/polyfills/getFirstHiddenTimePolyfill.js +0 -25
- package/front_end/third_party/web-vitals/package/dist/modules/onFID.d.ts +0 -13
- package/front_end/third_party/web-vitals/package/dist/modules/onFID.js +0 -70
- package/front_end/third_party/web-vitals/package/dist/modules/types/fid.d.ts +0 -46
- package/front_end/third_party/web-vitals/package/dist/modules/types/fid.js +0 -16
- package/front_end/third_party/web-vitals/package/src/attribution/onFID.ts +0 -62
- package/front_end/third_party/web-vitals/package/src/lib/interactions.ts +0 -139
- package/front_end/third_party/web-vitals/package/src/lib/onHidden.ts +0 -23
- package/front_end/third_party/web-vitals/package/src/lib/polyfills/firstInputPolyfill.ts +0 -174
- package/front_end/third_party/web-vitals/package/src/onFID.ts +0 -105
- package/front_end/third_party/web-vitals/package/src/types/fid.ts +0 -65
- package/front_end/ui/components/text_editor/textEditor.css +0 -18
- package/front_end/ui/legacy/inlineButton.css +0 -22
- /package/front_end/entrypoints/{rehydrated_devtools_app/rehydrated_devtools_app.ts → trace_app/trace_app.ts} +0 -0
- /package/front_end/{models/persistence → panels/settings}/editFileSystemView.css +0 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// Copyright 2016 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable rulesdir/no-imperative-dom-api */
|
|
5
|
-
/* eslint-disable rulesdir/no-lit-render-outside-of-view */
|
|
6
4
|
|
|
7
5
|
import '../../ui/legacy/legacy.js';
|
|
8
6
|
|
|
@@ -15,7 +13,7 @@ import * as Bindings from '../../models/bindings/bindings.js';
|
|
|
15
13
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
16
14
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
17
15
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
18
|
-
import {Directives, html,
|
|
16
|
+
import {Directives, html, i18nTemplate as unboundI18nTemplate, render, type TemplateResult} from '../../ui/lit/lit.js';
|
|
19
17
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
20
18
|
|
|
21
19
|
import {CoverageDecorationManager} from './CoverageDecorationManager.js';
|
|
@@ -126,76 +124,50 @@ const UIStrings = {
|
|
|
126
124
|
} as const;
|
|
127
125
|
const str_ = i18n.i18n.registerUIStrings('panels/coverage/CoverageView.ts', UIStrings);
|
|
128
126
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
127
|
+
const i18nTemplate = unboundI18nTemplate.bind(undefined, str_);
|
|
129
128
|
const {ref} = Directives;
|
|
130
129
|
const {bindToAction} = UI.UIUtils;
|
|
131
130
|
const {bindToSetting} = UI.SettingsUI;
|
|
131
|
+
const {widgetConfig} = UI.Widget;
|
|
132
132
|
|
|
133
133
|
let coverageViewInstance: CoverageView|undefined;
|
|
134
134
|
|
|
135
|
-
export
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
private coverageResultsElement!: HTMLElement;
|
|
153
|
-
private readonly landingPage: UI.Widget.VBox;
|
|
154
|
-
private readonly bfcacheReloadPromptPage: UI.Widget.VBox;
|
|
155
|
-
private readonly activationReloadPromptPage: UI.Widget.VBox;
|
|
156
|
-
private listView: CoverageListView;
|
|
157
|
-
private statusMessageElement!: HTMLElement;
|
|
158
|
-
|
|
159
|
-
constructor() {
|
|
160
|
-
super({
|
|
161
|
-
jslog: `${VisualLogging.panel('coverage').track({resize: true})}`,
|
|
162
|
-
useShadowDom: true,
|
|
163
|
-
});
|
|
164
|
-
this.registerRequiredCSS(coverageViewStyles);
|
|
165
|
-
|
|
166
|
-
this.model = null;
|
|
167
|
-
this.decorationManager = null;
|
|
168
|
-
|
|
169
|
-
this.coverageTypeComboBoxSetting =
|
|
170
|
-
Common.Settings.Settings.instance().createSetting('coverage-view-coverage-type', 0);
|
|
171
|
-
|
|
172
|
-
this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.toggle-recording');
|
|
173
|
-
|
|
174
|
-
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
175
|
-
const mainTargetSupportsRecordOnReload = Boolean(mainTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel));
|
|
176
|
-
this.inlineReloadButton = null;
|
|
177
|
-
this.clearAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.clear');
|
|
178
|
-
this.clearAction.setEnabled(false);
|
|
179
|
-
this.exportAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.export');
|
|
180
|
-
this.exportAction.setEnabled(false);
|
|
181
|
-
|
|
182
|
-
this.textFilterRegExp = null;
|
|
135
|
+
export interface CoverageViewInput {
|
|
136
|
+
coverageType: number;
|
|
137
|
+
recording: boolean;
|
|
138
|
+
supportsRecordOnReload: boolean;
|
|
139
|
+
textFilter: RegExp|null;
|
|
140
|
+
typeFilter: number|null;
|
|
141
|
+
showContentScriptsSetting: Common.Settings.Setting<boolean>;
|
|
142
|
+
|
|
143
|
+
needsReload: 'bfcache-page'|'prerender-page'|null;
|
|
144
|
+
coverageInfo: CoverageListItem[]|null;
|
|
145
|
+
selectedUrl: Platform.DevToolsPath.UrlString|null;
|
|
146
|
+
statusMessage: string;
|
|
147
|
+
|
|
148
|
+
onCoverageTypeChanged: (newValue: number) => void;
|
|
149
|
+
onFilterChanged: (e: string) => void;
|
|
150
|
+
onTypeFilterChanged: (newValue: number) => void;
|
|
151
|
+
}
|
|
183
152
|
|
|
184
|
-
|
|
153
|
+
export interface CoverageViewOutput {
|
|
154
|
+
focusResults: () => void;
|
|
155
|
+
}
|
|
185
156
|
|
|
186
|
-
|
|
187
|
-
this.showContentScriptsSetting.addChangeListener(this.onFilterChanged, this);
|
|
157
|
+
export type View = (input: CoverageViewInput, output: CoverageViewOutput, target: HTMLElement) => void;
|
|
188
158
|
|
|
189
|
-
|
|
190
|
-
|
|
159
|
+
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
160
|
+
// clang-format off
|
|
161
|
+
render(html`
|
|
191
162
|
<style>${coverageViewStyles}</style>
|
|
192
163
|
<div class="coverage-toolbar-container" jslog=${VisualLogging.toolbar()} role="toolbar">
|
|
193
164
|
<devtools-toolbar class="coverage-toolbar" role="presentation" wrappable>
|
|
194
165
|
<select title=${i18nString(UIStrings.chooseCoverageGranularityPer)}
|
|
195
166
|
aria-label=${i18nString(UIStrings.chooseCoverageGranularityPer)}
|
|
196
167
|
jslog=${VisualLogging.dropDown('coverage-type').track({change: true})}
|
|
197
|
-
@change=${
|
|
198
|
-
|
|
168
|
+
@change=${(event: Event) => input.onCoverageTypeChanged((event.target as HTMLSelectElement).selectedIndex)}
|
|
169
|
+
.selectedIndex=${input.coverageType}
|
|
170
|
+
?disabled=${input.recording}>
|
|
199
171
|
<option value=${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}
|
|
200
172
|
jslog=${VisualLogging.item(`${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}`).track({click: true})}>
|
|
201
173
|
${i18nString(UIStrings.perFunction)}
|
|
@@ -205,65 +177,185 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
205
177
|
${i18nString(UIStrings.perBlock)}
|
|
206
178
|
</option>
|
|
207
179
|
</select>
|
|
208
|
-
${
|
|
209
|
-
|
|
210
|
-
${ref(e => { if (e instanceof Buttons.Button.Button) { this.startWithReloadButton = e; } })}>
|
|
211
|
-
</devtools-button>` : nothing}
|
|
212
|
-
<devtools-button ${bindToAction('coverage.toggle-recording')}
|
|
213
|
-
.disabled=${mainTargetSupportsRecordOnReload}
|
|
214
|
-
.hidden=${mainTargetSupportsRecordOnReload}
|
|
215
|
-
${ref(e => { if (e instanceof Buttons.Button.Button) { this.toggleRecordButton = e; } })}>
|
|
180
|
+
<devtools-button ${bindToAction(input.supportsRecordOnReload && !input.recording ?
|
|
181
|
+
'coverage.start-with-reload' : 'coverage.toggle-recording')}>
|
|
216
182
|
</devtools-button>
|
|
217
183
|
<devtools-button ${bindToAction('coverage.clear')}></devtools-button>
|
|
218
184
|
<div class="toolbar-divider"></div>
|
|
219
185
|
<devtools-button ${bindToAction('coverage.export')}></devtools-button>
|
|
220
186
|
<div class="toolbar-divider"></div>
|
|
221
187
|
<devtools-toolbar-input type="filter" placeholder=${i18nString(UIStrings.filterByUrl)}
|
|
222
|
-
disabled
|
|
223
|
-
|
|
188
|
+
?disabled=${!Boolean(input.coverageInfo)}
|
|
189
|
+
@change=${(e: CustomEvent<string>) => input.onFilterChanged(e.detail)}
|
|
190
|
+
style="flex-grow:1; flex-shrink:1">
|
|
224
191
|
</devtools-toolbar-input>
|
|
225
192
|
<div class="toolbar-divider"></div>
|
|
226
193
|
<select title=${i18nString(UIStrings.filterCoverageByType)}
|
|
227
194
|
aria-label=${i18nString(UIStrings.filterCoverageByType)}
|
|
228
|
-
jslog=${VisualLogging.dropDown('coverage-by-type').track({change: true})}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
195
|
+
jslog=${VisualLogging.dropDown('coverage-by-type').track({change: true})}
|
|
196
|
+
?disabled=${!Boolean(input.coverageInfo)}
|
|
197
|
+
@change=${(event: Event) => input.onTypeFilterChanged(
|
|
198
|
+
Number((event.target as HTMLSelectElement).selectedOptions[0]?.value))}>
|
|
199
|
+
<option value="" jslog=${VisualLogging.item('').track({click: true})}
|
|
200
|
+
.selected=${input.typeFilter === null}>${i18nString(UIStrings.all)}</option>
|
|
232
201
|
<option value=${CoverageType.CSS}
|
|
233
|
-
jslog=${VisualLogging.item(`${CoverageType.CSS}`).track({click: true})}
|
|
202
|
+
jslog=${VisualLogging.item(`${CoverageType.CSS}`).track({click: true})}
|
|
203
|
+
.selected=${input.typeFilter === CoverageType.CSS}>
|
|
234
204
|
${i18nString(UIStrings.css)}
|
|
235
205
|
</option>
|
|
236
206
|
<option value=${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}
|
|
237
|
-
jslog=${VisualLogging.item(`${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}`).track({click: true})}
|
|
207
|
+
jslog=${VisualLogging.item(`${CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION}`).track({click: true})}
|
|
208
|
+
.selected=${(input.typeFilter !== null && Boolean(input.typeFilter & (CoverageType.JAVA_SCRIPT | CoverageType.JAVA_SCRIPT_PER_FUNCTION)))}>
|
|
238
209
|
${i18nString(UIStrings.javascript)}
|
|
239
210
|
</option>
|
|
240
211
|
</select>
|
|
241
212
|
<div class="toolbar-divider"></div>
|
|
242
|
-
<devtools-checkbox title=${i18nString(UIStrings.includeExtensionContentScripts)}
|
|
243
|
-
${bindToSetting(
|
|
244
|
-
|
|
213
|
+
<devtools-checkbox title=${i18nString(UIStrings.includeExtensionContentScripts)}
|
|
214
|
+
${bindToSetting(input.showContentScriptsSetting)}
|
|
215
|
+
?disabled=${!Boolean(input.coverageInfo)}>
|
|
245
216
|
${i18nString(UIStrings.contentScripts)}
|
|
246
217
|
</devtools-checkbox>
|
|
247
218
|
</devtools-toolbar>
|
|
248
219
|
</div>
|
|
249
|
-
<div class="coverage-results"
|
|
250
|
-
|
|
220
|
+
<div class="coverage-results">
|
|
221
|
+
${input.needsReload ?
|
|
222
|
+
renderReloadPromptPage(input.needsReload === 'bfcache-page' ?
|
|
223
|
+
i18nString(UIStrings.bfcacheNoCapture) : i18nString(UIStrings.activationNoCapture),
|
|
224
|
+
input.needsReload)
|
|
225
|
+
: input.coverageInfo ? html`
|
|
226
|
+
<devtools-widget autofocus class="results" .widgetConfig=${widgetConfig(CoverageListView, {
|
|
227
|
+
coverageInfo: input.coverageInfo,
|
|
228
|
+
highlightRegExp: input.textFilter,
|
|
229
|
+
selectedUrl: input.selectedUrl,
|
|
230
|
+
})}
|
|
231
|
+
${ref(e => { if (e instanceof HTMLElement) { output.focusResults = () => { e.focus(); };}})}>`
|
|
232
|
+
: renderLandingPage(input.supportsRecordOnReload)}
|
|
251
233
|
</div>
|
|
252
234
|
<div class="coverage-toolbar-summary">
|
|
253
|
-
<div class="coverage-message"
|
|
254
|
-
|
|
235
|
+
<div class="coverage-message">
|
|
236
|
+
${input.statusMessage}
|
|
255
237
|
</div>
|
|
256
|
-
</div>`,
|
|
238
|
+
</div>`, target);
|
|
239
|
+
// clang-format on
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
function renderLandingPage(supportsRecordOnReload: boolean): TemplateResult {
|
|
243
|
+
if (supportsRecordOnReload) {
|
|
244
|
+
// clang-format off
|
|
245
|
+
return html`
|
|
246
|
+
<devtools-widget .widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget,{
|
|
247
|
+
header: i18nString(UIStrings.noCoverageData),
|
|
248
|
+
link: 'https://developer.chrome.com/docs/devtools/coverage' as Platform.DevToolsPath.UrlString,
|
|
249
|
+
text: i18nString(UIStrings.clickTheReloadButtonSToReloadAnd, {PH1: i18nString(UIStrings.reloadPage)}),
|
|
250
|
+
})}>
|
|
251
|
+
<devtools-button ${bindToAction('coverage.start-with-reload')}
|
|
252
|
+
.variant=${Buttons.Button.Variant.TONAL} .iconName=${undefined}>
|
|
253
|
+
${i18nString(UIStrings.reloadPage)}
|
|
254
|
+
</devtools-button>
|
|
255
|
+
</devtools-widget>`;
|
|
257
256
|
// clang-format on
|
|
257
|
+
}
|
|
258
|
+
// clang-format off
|
|
259
|
+
return html`
|
|
260
|
+
<devtools-widget .widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget,{
|
|
261
|
+
header: i18nString(UIStrings.noCoverageData),
|
|
262
|
+
link: 'https://developer.chrome.com/docs/devtools/coverage' as Platform.DevToolsPath.UrlString,
|
|
263
|
+
text: i18nString(UIStrings.clickTheRecordButtonSToStart, {PH1: i18nString(UIStrings.startRecording)}),
|
|
264
|
+
})}>
|
|
265
|
+
<devtools-button ${bindToAction('coverage.toggle-recording')}
|
|
266
|
+
.variant=${Buttons.Button.Variant.TONAL} .iconName=${undefined}>
|
|
267
|
+
${i18nString(UIStrings.startRecording)}
|
|
268
|
+
</devtools-button>
|
|
269
|
+
</devtools-widget>`;
|
|
270
|
+
// clang-format on
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function renderReloadPromptPage(message: Common.UIString.LocalizedString, className: string): TemplateResult {
|
|
274
|
+
// clang-format off
|
|
275
|
+
return html`
|
|
276
|
+
<div class="widget vbox ${className}">
|
|
277
|
+
<div class="message">${message}</div>
|
|
278
|
+
<span class="message">
|
|
279
|
+
${i18nTemplate(UIStrings.reloadPrompt, {PH1: html`
|
|
280
|
+
<devtools-button class="inline-button" ${bindToAction('inspector-main.reload')}></devtools-button>`})}
|
|
281
|
+
</span>
|
|
282
|
+
</div>`;
|
|
283
|
+
// clang-format on
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export class CoverageView extends UI.Widget.VBox {
|
|
287
|
+
#model: CoverageModel|null;
|
|
288
|
+
#decorationManager: CoverageDecorationManager|null;
|
|
289
|
+
readonly #coverageTypeComboBoxSetting: Common.Settings.Setting<number>;
|
|
290
|
+
readonly #toggleRecordAction: UI.ActionRegistration.Action;
|
|
291
|
+
readonly #clearAction: UI.ActionRegistration.Action;
|
|
292
|
+
readonly #exportAction: UI.ActionRegistration.Action;
|
|
293
|
+
#textFilter: RegExp|null;
|
|
294
|
+
#typeFilter: number|null;
|
|
295
|
+
readonly #showContentScriptsSetting: Common.Settings.Setting<boolean>;
|
|
296
|
+
|
|
297
|
+
readonly #view: View;
|
|
298
|
+
#supportsRecordOnReload: boolean;
|
|
299
|
+
#needsReload: 'bfcache-page'|'prerender-page'|null = null;
|
|
300
|
+
#statusMessage = '';
|
|
301
|
+
#output: CoverageViewOutput = {focusResults: () => {}};
|
|
302
|
+
#coverageInfo: CoverageListItem[]|null = null;
|
|
303
|
+
#selectedUrl: Platform.DevToolsPath.UrlString|null = null;
|
|
304
|
+
|
|
305
|
+
constructor(view: View = DEFAULT_VIEW) {
|
|
306
|
+
super({
|
|
307
|
+
jslog: `${VisualLogging.panel('coverage').track({resize: true})}`,
|
|
308
|
+
useShadowDom: true,
|
|
309
|
+
delegatesFocus: true,
|
|
310
|
+
});
|
|
311
|
+
this.registerRequiredCSS(coverageViewStyles);
|
|
312
|
+
this.#view = view;
|
|
313
|
+
|
|
314
|
+
this.#model = null;
|
|
315
|
+
this.#decorationManager = null;
|
|
316
|
+
|
|
317
|
+
this.#coverageTypeComboBoxSetting =
|
|
318
|
+
Common.Settings.Settings.instance().createSetting('coverage-view-coverage-type', 0);
|
|
319
|
+
|
|
320
|
+
this.#toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.toggle-recording');
|
|
258
321
|
|
|
259
|
-
|
|
260
|
-
this
|
|
261
|
-
this
|
|
262
|
-
this.
|
|
263
|
-
|
|
264
|
-
this.
|
|
322
|
+
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
323
|
+
this.#supportsRecordOnReload = Boolean(mainTarget?.model(SDK.ResourceTreeModel.ResourceTreeModel));
|
|
324
|
+
this.#clearAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.clear');
|
|
325
|
+
this.#clearAction.setEnabled(false);
|
|
326
|
+
this.#exportAction = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.export');
|
|
327
|
+
this.#exportAction.setEnabled(false);
|
|
328
|
+
|
|
329
|
+
this.#textFilter = null;
|
|
330
|
+
|
|
331
|
+
this.#typeFilter = null;
|
|
265
332
|
|
|
266
|
-
this.
|
|
333
|
+
this.#showContentScriptsSetting = Common.Settings.Settings.instance().createSetting('show-content-scripts', false);
|
|
334
|
+
this.#showContentScriptsSetting.addChangeListener(this.#onFilterChanged, this);
|
|
335
|
+
|
|
336
|
+
this.requestUpdate();
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
override performUpdate(): void {
|
|
340
|
+
const input: CoverageViewInput = {
|
|
341
|
+
coverageType: this.#coverageTypeComboBoxSetting.get(),
|
|
342
|
+
recording: this.#toggleRecordAction.toggled(),
|
|
343
|
+
supportsRecordOnReload: this.#supportsRecordOnReload,
|
|
344
|
+
typeFilter: this.#typeFilter,
|
|
345
|
+
showContentScriptsSetting: this.#showContentScriptsSetting,
|
|
346
|
+
needsReload: this.#needsReload,
|
|
347
|
+
coverageInfo: this.#coverageInfo,
|
|
348
|
+
textFilter: this.#textFilter,
|
|
349
|
+
selectedUrl: this.#selectedUrl,
|
|
350
|
+
statusMessage: this.#statusMessage,
|
|
351
|
+
onCoverageTypeChanged: this.#onCoverageTypeChanged.bind(this),
|
|
352
|
+
onFilterChanged: (value: string) => {
|
|
353
|
+
this.#textFilter = value ? Platform.StringUtilities.createPlainTextSearchRegex(value, 'i') : null;
|
|
354
|
+
this.#onFilterChanged();
|
|
355
|
+
},
|
|
356
|
+
onTypeFilterChanged: this.#onTypeFilterChanged.bind(this),
|
|
357
|
+
};
|
|
358
|
+
this.#view(input, this.#output, this.contentElement);
|
|
267
359
|
}
|
|
268
360
|
|
|
269
361
|
static instance(): CoverageView {
|
|
@@ -277,68 +369,27 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
277
369
|
coverageViewInstance = undefined;
|
|
278
370
|
}
|
|
279
371
|
|
|
280
|
-
private buildLandingPage(): UI.Widget.VBox {
|
|
281
|
-
const widget = new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noCoverageData), '');
|
|
282
|
-
widget.link = 'https://developer.chrome.com/docs/devtools/coverage' as Platform.DevToolsPath.UrlString;
|
|
283
|
-
if (this.startWithReloadButton) {
|
|
284
|
-
const action = UI.ActionRegistry.ActionRegistry.instance().getAction('coverage.start-with-reload');
|
|
285
|
-
if (action) {
|
|
286
|
-
widget.text = i18nString(UIStrings.clickTheReloadButtonSToReloadAnd, {PH1: i18nString(UIStrings.reloadPage)});
|
|
287
|
-
const button = UI.UIUtils.createTextButton(
|
|
288
|
-
i18nString(UIStrings.reloadPage), () => action.execute(),
|
|
289
|
-
{jslogContext: action.id(), variant: Buttons.Button.Variant.TONAL});
|
|
290
|
-
widget.contentElement.append(button);
|
|
291
|
-
}
|
|
292
|
-
} else {
|
|
293
|
-
widget.text = i18nString(UIStrings.clickTheRecordButtonSToStart, {PH1: i18nString(UIStrings.startRecording)});
|
|
294
|
-
const button = UI.UIUtils.createTextButton(
|
|
295
|
-
i18nString(UIStrings.startRecording), () => this.toggleRecordAction.execute(),
|
|
296
|
-
{jslogContext: this.toggleRecordAction.id(), variant: Buttons.Button.Variant.TONAL});
|
|
297
|
-
widget.contentElement.append(button);
|
|
298
|
-
}
|
|
299
|
-
return widget;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
private buildReloadPromptPage(message: Common.UIString.LocalizedString, className: string): UI.Widget.VBox {
|
|
303
|
-
const widget = new UI.Widget.VBox();
|
|
304
|
-
const reasonDiv = document.createElement('div');
|
|
305
|
-
reasonDiv.classList.add('message');
|
|
306
|
-
reasonDiv.textContent = message;
|
|
307
|
-
widget.contentElement.appendChild(reasonDiv);
|
|
308
|
-
this.inlineReloadButton =
|
|
309
|
-
UI.UIUtils.createInlineButton(UI.Toolbar.Toolbar.createActionButton('inspector-main.reload'));
|
|
310
|
-
const messageElement =
|
|
311
|
-
i18n.i18n.getFormatLocalizedString(str_, UIStrings.reloadPrompt, {PH1: this.inlineReloadButton});
|
|
312
|
-
messageElement.classList.add('message');
|
|
313
|
-
widget.contentElement.appendChild(messageElement);
|
|
314
|
-
widget.element.classList.add(className);
|
|
315
|
-
return widget;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
372
|
clear(): void {
|
|
319
|
-
if (this
|
|
320
|
-
this
|
|
373
|
+
if (this.#model) {
|
|
374
|
+
this.#model.reset();
|
|
321
375
|
}
|
|
322
|
-
this
|
|
376
|
+
this.#reset();
|
|
323
377
|
}
|
|
324
378
|
|
|
325
|
-
|
|
326
|
-
if (this
|
|
327
|
-
this
|
|
328
|
-
this
|
|
379
|
+
#reset(): void {
|
|
380
|
+
if (this.#decorationManager) {
|
|
381
|
+
this.#decorationManager.dispose();
|
|
382
|
+
this.#decorationManager = null;
|
|
329
383
|
}
|
|
330
|
-
this
|
|
331
|
-
this
|
|
332
|
-
this
|
|
333
|
-
this.
|
|
334
|
-
this.
|
|
335
|
-
this.filterByTypeComboBox.disabled = true;
|
|
336
|
-
this.contentScriptsCheckbox.disabled = true;
|
|
337
|
-
this.exportAction.setEnabled(false);
|
|
384
|
+
this.#needsReload = null;
|
|
385
|
+
this.#coverageInfo = null;
|
|
386
|
+
this.#statusMessage = '';
|
|
387
|
+
this.#exportAction.setEnabled(false);
|
|
388
|
+
this.requestUpdate();
|
|
338
389
|
}
|
|
339
390
|
|
|
340
391
|
toggleRecording(): void {
|
|
341
|
-
const enable = !this
|
|
392
|
+
const enable = !this.#toggleRecordAction.toggled();
|
|
342
393
|
|
|
343
394
|
if (enable) {
|
|
344
395
|
void this.startRecording({reload: false, jsCoveragePerBlock: this.isBlockCoverageSelected()});
|
|
@@ -348,31 +399,22 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
348
399
|
}
|
|
349
400
|
|
|
350
401
|
isBlockCoverageSelected(): boolean {
|
|
351
|
-
const option = this.coverageTypeComboBox.selectedOptions[0];
|
|
352
|
-
const coverageType = Number(option ? option.value : Number.NaN);
|
|
353
402
|
// Check that Coverage.CoverageType.JavaScriptPerFunction is not present.
|
|
354
|
-
return
|
|
403
|
+
return this.#coverageTypeComboBoxSetting.get() === CoverageType.JAVA_SCRIPT;
|
|
355
404
|
}
|
|
356
405
|
|
|
357
|
-
|
|
406
|
+
#selectCoverageType(jsCoveragePerBlock: boolean): void {
|
|
358
407
|
const selectedIndex = jsCoveragePerBlock ? 1 : 0;
|
|
359
|
-
this.
|
|
408
|
+
this.#coverageTypeComboBoxSetting.set(selectedIndex);
|
|
360
409
|
}
|
|
361
410
|
|
|
362
|
-
|
|
363
|
-
this
|
|
411
|
+
#onCoverageTypeChanged(newValue: number): void {
|
|
412
|
+
this.#coverageTypeComboBoxSetting.set(newValue);
|
|
364
413
|
}
|
|
365
414
|
|
|
366
415
|
async startRecording(options: {reload: (boolean|undefined), jsCoveragePerBlock: (boolean|undefined)}|null):
|
|
367
416
|
Promise<void> {
|
|
368
|
-
|
|
369
|
-
if ((this.startWithReloadButton?.hasFocus()) || (this.inlineReloadButton?.hasFocus())) {
|
|
370
|
-
reloadButtonFocused = true;
|
|
371
|
-
} else if (this.hasFocus()) {
|
|
372
|
-
hadFocus = true;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
this.reset();
|
|
417
|
+
this.#reset();
|
|
376
418
|
const mainTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
377
419
|
if (!mainTarget) {
|
|
378
420
|
return;
|
|
@@ -380,77 +422,63 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
380
422
|
|
|
381
423
|
const {reload, jsCoveragePerBlock} = {reload: false, jsCoveragePerBlock: false, ...options};
|
|
382
424
|
|
|
383
|
-
if (!this
|
|
384
|
-
this
|
|
425
|
+
if (!this.#model || reload) {
|
|
426
|
+
this.#model = mainTarget.model(CoverageModel);
|
|
385
427
|
}
|
|
386
|
-
if (!this
|
|
428
|
+
if (!this.#model) {
|
|
387
429
|
return;
|
|
388
430
|
}
|
|
389
431
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CoverageStarted);
|
|
390
432
|
if (jsCoveragePerBlock) {
|
|
391
433
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CoverageStartedPerBlock);
|
|
392
434
|
}
|
|
393
|
-
const success = await this
|
|
435
|
+
const success = await this.#model.start(Boolean(jsCoveragePerBlock));
|
|
394
436
|
if (!success) {
|
|
395
437
|
return;
|
|
396
438
|
}
|
|
397
|
-
this
|
|
398
|
-
this
|
|
399
|
-
this
|
|
439
|
+
this.#selectCoverageType(Boolean(jsCoveragePerBlock));
|
|
440
|
+
this.#model.addEventListener(Events.CoverageUpdated, this.#onCoverageDataReceived, this);
|
|
441
|
+
this.#model.addEventListener(Events.SourceMapResolved, this.#updateListView, this);
|
|
400
442
|
const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
401
443
|
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
402
444
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
403
|
-
this
|
|
404
|
-
this
|
|
405
|
-
this
|
|
445
|
+
this.#onPrimaryPageChanged, this);
|
|
446
|
+
this.#decorationManager = new CoverageDecorationManager(
|
|
447
|
+
this.#model, Workspace.Workspace.WorkspaceImpl.instance(),
|
|
406
448
|
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(),
|
|
407
449
|
Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance());
|
|
408
|
-
this
|
|
409
|
-
this
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
this.toggleRecordButton.focus();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
this.coverageTypeComboBox.disabled = true;
|
|
420
|
-
this.filterInput.disabled = false;
|
|
421
|
-
this.filterByTypeComboBox.disabled = false;
|
|
422
|
-
this.contentScriptsCheckbox.disabled = false;
|
|
423
|
-
if (this.landingPage.isShowing()) {
|
|
424
|
-
this.landingPage.detach();
|
|
425
|
-
}
|
|
426
|
-
this.listView.show(this.coverageResultsElement);
|
|
427
|
-
if (hadFocus && !reloadButtonFocused) {
|
|
428
|
-
this.listView.focus();
|
|
429
|
-
}
|
|
450
|
+
this.#toggleRecordAction.setToggled(true);
|
|
451
|
+
this.#clearAction.setEnabled(false);
|
|
452
|
+
this.#coverageInfo = [];
|
|
453
|
+
this.#needsReload = null;
|
|
454
|
+
this.requestUpdate();
|
|
455
|
+
await this.updateComplete;
|
|
456
|
+
|
|
457
|
+
this.#output.focusResults();
|
|
430
458
|
if (reload && resourceTreeModel) {
|
|
431
459
|
resourceTreeModel.reloadPage();
|
|
432
460
|
} else {
|
|
433
|
-
void this
|
|
461
|
+
void this.#model.startPolling();
|
|
434
462
|
}
|
|
435
463
|
}
|
|
436
464
|
|
|
437
|
-
|
|
465
|
+
#onCoverageDataReceived(event: Common.EventTarget.EventTargetEvent<CoverageInfo[]>): void {
|
|
438
466
|
const data = event.data;
|
|
439
|
-
this
|
|
467
|
+
this.#updateViews(data);
|
|
440
468
|
}
|
|
441
469
|
|
|
442
|
-
|
|
470
|
+
#updateListView(): void {
|
|
443
471
|
const entries =
|
|
444
|
-
(this
|
|
445
|
-
.map(entry => this
|
|
446
|
-
.filter(info => this
|
|
472
|
+
(this.#model?.entries() || [])
|
|
473
|
+
.map(entry => this.#toCoverageListItem(entry))
|
|
474
|
+
.filter(info => this.#isVisible(info))
|
|
447
475
|
.map(
|
|
448
476
|
(entry: CoverageListItem) =>
|
|
449
|
-
({...entry, sources: entry.sources.filter((entry: CoverageListItem) => this
|
|
450
|
-
this
|
|
477
|
+
({...entry, sources: entry.sources.filter((entry: CoverageListItem) => this.#isVisible(entry))}));
|
|
478
|
+
this.#coverageInfo = entries;
|
|
451
479
|
}
|
|
452
480
|
|
|
453
|
-
|
|
481
|
+
#toCoverageListItem(info: URLCoverageInfo): CoverageListItem {
|
|
454
482
|
return {
|
|
455
483
|
url: info.url(),
|
|
456
484
|
type: info.type(),
|
|
@@ -459,7 +487,7 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
459
487
|
unusedSize: info.unusedSize(),
|
|
460
488
|
usedPercentage: info.usedPercentage(),
|
|
461
489
|
unusedPercentage: info.unusedPercentage(),
|
|
462
|
-
sources: [...info.sourcesURLCoverageInfo.values()].map(this
|
|
490
|
+
sources: [...info.sourcesURLCoverageInfo.values()].map(this.#toCoverageListItem, this),
|
|
463
491
|
isContentScript: info.isContentScript(),
|
|
464
492
|
generatedUrl: info instanceof SourceURLCoverageInfo ? info.generatedURLCoverageInfo.url() : undefined,
|
|
465
493
|
};
|
|
@@ -468,27 +496,18 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
468
496
|
async stopRecording(): Promise<void> {
|
|
469
497
|
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
470
498
|
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
471
|
-
this
|
|
472
|
-
if (this.hasFocus()) {
|
|
473
|
-
this.listView.focus();
|
|
474
|
-
}
|
|
499
|
+
this.#onPrimaryPageChanged, this);
|
|
475
500
|
// Stopping the model triggers one last poll to get the final data.
|
|
476
|
-
if (this
|
|
477
|
-
await this
|
|
478
|
-
this
|
|
501
|
+
if (this.#model) {
|
|
502
|
+
await this.#model.stop();
|
|
503
|
+
this.#model.removeEventListener(Events.CoverageUpdated, this.#onCoverageDataReceived, this);
|
|
479
504
|
}
|
|
480
|
-
this
|
|
481
|
-
this.
|
|
482
|
-
|
|
483
|
-
this.startWithReloadButton.disabled = false;
|
|
484
|
-
this.startWithReloadButton.hidden = false;
|
|
485
|
-
this.toggleRecordButton.disabled = true;
|
|
486
|
-
this.toggleRecordButton.hidden = true;
|
|
487
|
-
}
|
|
488
|
-
this.clearAction.setEnabled(true);
|
|
505
|
+
this.#toggleRecordAction.setToggled(false);
|
|
506
|
+
this.#clearAction.setEnabled(true);
|
|
507
|
+
this.requestUpdate();
|
|
489
508
|
}
|
|
490
509
|
|
|
491
|
-
|
|
510
|
+
async #onPrimaryPageChanged(
|
|
492
511
|
event: Common.EventTarget.EventTargetEvent<
|
|
493
512
|
{frame: SDK.ResourceTreeModel.ResourceTreeFrame, type: SDK.ResourceTreeModel.PrimaryPageChangeType}>):
|
|
494
513
|
Promise<void> {
|
|
@@ -498,71 +517,64 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
498
517
|
return;
|
|
499
518
|
}
|
|
500
519
|
// If the primary page target has changed (due to MPArch activation), switch to new CoverageModel.
|
|
501
|
-
if (this
|
|
502
|
-
if (this
|
|
503
|
-
await this
|
|
504
|
-
this
|
|
520
|
+
if (this.#model !== coverageModel) {
|
|
521
|
+
if (this.#model) {
|
|
522
|
+
await this.#model.stop();
|
|
523
|
+
this.#model.removeEventListener(Events.CoverageUpdated, this.#onCoverageDataReceived, this);
|
|
505
524
|
}
|
|
506
|
-
this
|
|
507
|
-
const success = await this
|
|
525
|
+
this.#model = coverageModel;
|
|
526
|
+
const success = await this.#model.start(this.isBlockCoverageSelected());
|
|
508
527
|
if (!success) {
|
|
509
528
|
return;
|
|
510
529
|
}
|
|
511
530
|
|
|
512
|
-
this
|
|
513
|
-
this
|
|
514
|
-
this
|
|
531
|
+
this.#model.addEventListener(Events.CoverageUpdated, this.#onCoverageDataReceived, this);
|
|
532
|
+
this.#decorationManager = new CoverageDecorationManager(
|
|
533
|
+
this.#model, Workspace.Workspace.WorkspaceImpl.instance(),
|
|
515
534
|
Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance(),
|
|
516
535
|
Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance());
|
|
517
536
|
}
|
|
518
537
|
|
|
519
|
-
if (this.bfcacheReloadPromptPage.isShowing()) {
|
|
520
|
-
this.bfcacheReloadPromptPage.detach();
|
|
521
|
-
this.listView.show(this.coverageResultsElement);
|
|
522
|
-
}
|
|
523
|
-
if (this.activationReloadPromptPage.isShowing()) {
|
|
524
|
-
this.activationReloadPromptPage.detach();
|
|
525
|
-
this.listView.show(this.coverageResultsElement);
|
|
526
|
-
}
|
|
527
|
-
if (frame.backForwardCacheDetails.restoredFromCache) {
|
|
528
|
-
this.listView.detach();
|
|
529
|
-
this.bfcacheReloadPromptPage.show(this.coverageResultsElement);
|
|
530
|
-
}
|
|
531
538
|
if (event.data.type === SDK.ResourceTreeModel.PrimaryPageChangeType.ACTIVATION) {
|
|
532
|
-
this
|
|
533
|
-
|
|
539
|
+
this.#needsReload = 'prerender-page';
|
|
540
|
+
} else if (frame.backForwardCacheDetails.restoredFromCache) {
|
|
541
|
+
this.#needsReload = 'bfcache-page';
|
|
542
|
+
} else {
|
|
543
|
+
this.#needsReload = null;
|
|
544
|
+
this.#coverageInfo = [];
|
|
534
545
|
}
|
|
546
|
+
this.requestUpdate();
|
|
535
547
|
|
|
536
|
-
this
|
|
537
|
-
this
|
|
538
|
-
this.
|
|
539
|
-
void this.model.startPolling();
|
|
548
|
+
this.#model.reset();
|
|
549
|
+
this.#decorationManager?.reset();
|
|
550
|
+
void this.#model.startPolling();
|
|
540
551
|
}
|
|
541
552
|
|
|
542
|
-
|
|
543
|
-
this
|
|
544
|
-
this
|
|
545
|
-
this
|
|
546
|
-
this
|
|
553
|
+
#updateViews(updatedEntries: CoverageInfo[]): void {
|
|
554
|
+
this.#updateStats();
|
|
555
|
+
this.#updateListView();
|
|
556
|
+
this.#exportAction.setEnabled(this.#model !== null && this.#model.entries().length > 0);
|
|
557
|
+
this.#decorationManager?.update(updatedEntries);
|
|
558
|
+
this.requestUpdate();
|
|
547
559
|
}
|
|
548
560
|
|
|
549
|
-
|
|
561
|
+
#updateStats(): void {
|
|
550
562
|
const all = {total: 0, unused: 0};
|
|
551
563
|
const filtered = {total: 0, unused: 0};
|
|
552
|
-
const filterApplied = this
|
|
553
|
-
if (this
|
|
554
|
-
for (const info of this
|
|
564
|
+
const filterApplied = this.#textFilter !== null;
|
|
565
|
+
if (this.#model) {
|
|
566
|
+
for (const info of this.#model.entries()) {
|
|
555
567
|
all.total += info.size();
|
|
556
568
|
all.unused += info.unusedSize();
|
|
557
|
-
const listItem = this
|
|
558
|
-
if (this
|
|
559
|
-
if (this
|
|
569
|
+
const listItem = this.#toCoverageListItem(info);
|
|
570
|
+
if (this.#isVisible(listItem)) {
|
|
571
|
+
if (this.#textFilter?.test(info.url())) {
|
|
560
572
|
filtered.total += info.size();
|
|
561
573
|
filtered.unused += info.unusedSize();
|
|
562
574
|
} else {
|
|
563
575
|
// If it doesn't match the filter, calculate the stats from visible children if there are any
|
|
564
576
|
for (const childInfo of info.sourcesURLCoverageInfo.values()) {
|
|
565
|
-
if (this
|
|
577
|
+
if (this.#isVisible(this.#toCoverageListItem(childInfo))) {
|
|
566
578
|
filtered.total += childInfo.size();
|
|
567
579
|
filtered.unused += childInfo.unusedSize();
|
|
568
580
|
}
|
|
@@ -571,7 +583,7 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
571
583
|
}
|
|
572
584
|
}
|
|
573
585
|
}
|
|
574
|
-
this
|
|
586
|
+
this.#statusMessage = filterApplied ?
|
|
575
587
|
i18nString(UIStrings.filteredSTotalS, {PH1: formatStat(filtered), PH2: formatStat(all)}) :
|
|
576
588
|
formatStat(all);
|
|
577
589
|
|
|
@@ -587,51 +599,42 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
587
599
|
}
|
|
588
600
|
}
|
|
589
601
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
const text = this.filterInput.value;
|
|
595
|
-
this.textFilterRegExp = text ? Platform.StringUtilities.createPlainTextSearchRegex(text, 'i') : null;
|
|
596
|
-
this.updateListView();
|
|
597
|
-
this.updateStats();
|
|
602
|
+
#onFilterChanged(): void {
|
|
603
|
+
this.#updateListView();
|
|
604
|
+
this.#updateStats();
|
|
605
|
+
this.requestUpdate();
|
|
598
606
|
}
|
|
599
607
|
|
|
600
|
-
|
|
601
|
-
if (!this.listView) {
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
|
|
608
|
+
#onTypeFilterChanged(typeFilter: number): void {
|
|
605
609
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CoverageReportFiltered);
|
|
606
610
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
this
|
|
610
|
-
this.
|
|
611
|
-
this.updateStats();
|
|
611
|
+
this.#typeFilter = typeFilter;
|
|
612
|
+
this.#updateListView();
|
|
613
|
+
this.#updateStats();
|
|
614
|
+
this.requestUpdate();
|
|
612
615
|
}
|
|
613
616
|
|
|
614
|
-
|
|
617
|
+
#isVisible(coverageInfo: CoverageListItem): boolean {
|
|
615
618
|
const url = coverageInfo.url;
|
|
616
619
|
if (url.startsWith(CoverageView.EXTENSION_BINDINGS_URL_PREFIX)) {
|
|
617
620
|
return false;
|
|
618
621
|
}
|
|
619
|
-
if (coverageInfo.isContentScript && !this
|
|
622
|
+
if (coverageInfo.isContentScript && !this.#showContentScriptsSetting.get()) {
|
|
620
623
|
return false;
|
|
621
624
|
}
|
|
622
|
-
if (this
|
|
625
|
+
if (this.#typeFilter && !(coverageInfo.type & this.#typeFilter)) {
|
|
623
626
|
return false;
|
|
624
627
|
}
|
|
625
628
|
// If it's a parent, check if any children are visible
|
|
626
629
|
if (coverageInfo.sources.length > 0) {
|
|
627
630
|
for (const sourceURLCoverageInfo of coverageInfo.sources) {
|
|
628
|
-
if (this
|
|
631
|
+
if (this.#isVisible(sourceURLCoverageInfo)) {
|
|
629
632
|
return true;
|
|
630
633
|
}
|
|
631
634
|
}
|
|
632
635
|
}
|
|
633
636
|
|
|
634
|
-
return !this
|
|
637
|
+
return !this.#textFilter || this.#textFilter.test(url);
|
|
635
638
|
}
|
|
636
639
|
|
|
637
640
|
async exportReport(): Promise<void> {
|
|
@@ -642,11 +645,12 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
642
645
|
if (!accepted) {
|
|
643
646
|
return;
|
|
644
647
|
}
|
|
645
|
-
this
|
|
648
|
+
this.#model && await this.#model.exportReport(fos);
|
|
646
649
|
}
|
|
647
650
|
|
|
648
651
|
selectCoverageItemByUrl(url: string): void {
|
|
649
|
-
this
|
|
652
|
+
this.#selectedUrl = url as Platform.DevToolsPath.UrlString;
|
|
653
|
+
this.requestUpdate();
|
|
650
654
|
}
|
|
651
655
|
|
|
652
656
|
static readonly EXTENSION_BINDINGS_URL_PREFIX = 'extensions::';
|
|
@@ -660,6 +664,10 @@ export class CoverageView extends UI.Widget.VBox {
|
|
|
660
664
|
super.willHide();
|
|
661
665
|
UI.Context.Context.instance().setFlavor(CoverageView, null);
|
|
662
666
|
}
|
|
667
|
+
|
|
668
|
+
get model(): CoverageModel|null {
|
|
669
|
+
return this.#model;
|
|
670
|
+
}
|
|
663
671
|
}
|
|
664
672
|
|
|
665
673
|
export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|