chrome-devtools-frontend 1.0.1512147 → 1.0.1513662
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/cookbook/release_management.md +15 -13
- package/docs/get_the_code.md +114 -35
- package/front_end/Images/src/ai-explorer-badge.svg +114 -0
- package/front_end/Images/src/code-whisperer-badge.svg +166 -0
- package/front_end/Images/src/devtools-user-badge.svg +129 -0
- package/front_end/Images/src/dom-detective-badge.svg +136 -0
- package/front_end/Images/src/speedster-badge.svg +166 -0
- package/front_end/core/common/Color.ts +40 -44
- package/front_end/core/common/Console.ts +4 -4
- package/front_end/core/common/ParsedURL.ts +14 -14
- package/front_end/core/common/ResourceType.ts +20 -20
- package/front_end/core/common/SegmentedRange.ts +13 -14
- package/front_end/core/common/Settings.ts +4 -4
- package/front_end/core/common/StringOutputStream.ts +4 -4
- package/front_end/core/host/GdpClient.ts +76 -2
- package/front_end/core/host/InspectorFrontendHost.ts +4 -1
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/host/ResourceLoader.ts +2 -2
- package/front_end/core/host/UserMetrics.ts +0 -2
- package/front_end/core/i18n/NumberFormatter.ts +7 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +9 -9
- package/front_end/core/root/Runtime.ts +5 -2
- package/front_end/core/sdk/AccessibilityModel.ts +48 -48
- package/front_end/core/sdk/AnimationModel.ts +78 -79
- package/front_end/core/sdk/CPUProfilerModel.ts +5 -5
- package/front_end/core/sdk/CPUThrottlingManager.ts +17 -17
- package/front_end/core/sdk/CSSMatchedStyles.ts +44 -44
- package/front_end/core/sdk/CSSMedia.ts +22 -22
- package/front_end/core/sdk/CSSModel.ts +4 -4
- package/front_end/core/sdk/CSSProperty.ts +9 -9
- package/front_end/core/sdk/CSSPropertyParser.ts +1 -2
- package/front_end/core/sdk/CSSRule.ts +3 -3
- package/front_end/core/sdk/CSSStyleDeclaration.ts +27 -28
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +13 -13
- package/front_end/core/sdk/CategorizedBreakpoint.ts +4 -4
- package/front_end/core/sdk/ChildTargetManager.ts +6 -6
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -4
- package/front_end/core/sdk/ConsoleModel.ts +24 -24
- package/front_end/core/sdk/Cookie.ts +16 -16
- package/front_end/core/sdk/CookieParser.ts +6 -6
- package/front_end/core/sdk/DOMDebuggerModel.ts +88 -89
- package/front_end/core/sdk/DOMModel.ts +113 -113
- package/front_end/core/sdk/DebuggerModel.ts +102 -103
- package/front_end/core/sdk/EmulationModel.ts +6 -6
- package/front_end/core/sdk/EventBreakpointsModel.ts +5 -5
- package/front_end/core/sdk/HeapProfilerModel.ts +5 -5
- package/front_end/core/sdk/IsolateManager.ts +26 -26
- package/front_end/core/sdk/LayerTreeBase.ts +29 -30
- package/front_end/core/sdk/OverlayModel.ts +6 -6
- package/front_end/core/sdk/Resource.ts +43 -43
- package/front_end/core/sdk/ResourceTreeModel.ts +58 -61
- package/front_end/core/sdk/RuntimeModel.ts +12 -13
- package/front_end/core/sdk/SDKModel.ts +3 -3
- package/front_end/core/sdk/Script.ts +17 -17
- package/front_end/core/sdk/SecurityOriginManager.ts +14 -14
- package/front_end/core/sdk/ServerTiming.ts +2 -2
- package/front_end/core/sdk/ServiceWorkerCacheModel.ts +15 -15
- package/front_end/core/sdk/ServiceWorkerManager.ts +19 -24
- package/front_end/core/sdk/SourceMap.ts +10 -10
- package/front_end/core/sdk/StorageKeyManager.ts +12 -12
- package/front_end/core/sdk/Target.ts +33 -34
- package/front_end/core/sdk/TargetManager.ts +20 -20
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +8 -8
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +7 -7
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -24
- package/front_end/entrypoints/main/GlobalAiButton.ts +3 -3
- package/front_end/entrypoints/main/MainImpl.ts +16 -14
- package/front_end/entrypoints/main/main-meta.ts +1 -2
- package/front_end/generated/InspectorBackendCommands.js +3 -2
- package/front_end/generated/SupportedCSSProperties.js +20 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +20 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +18 -35
- package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +246 -119
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +187 -73
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +106 -100
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +20 -27
- package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
- package/front_end/models/badges/AiExplorerBadge.ts +21 -0
- package/front_end/models/badges/Badge.ts +10 -9
- package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
- package/front_end/models/badges/DOMDetectiveBadge.ts +21 -0
- package/front_end/models/badges/SpeedsterBadge.ts +7 -2
- package/front_end/models/badges/StarterBadge.ts +6 -1
- package/front_end/models/badges/UserBadges.ts +61 -9
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +6 -6
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +18 -18
- package/front_end/models/bindings/FileUtils.ts +15 -15
- package/front_end/models/bindings/ResourceScriptMapping.ts +14 -14
- package/front_end/models/elements/ElementUpdateRecord.ts +11 -11
- package/front_end/models/emulation/DeviceModeModel.ts +123 -131
- package/front_end/models/emulation/EmulatedDevices.ts +22 -22
- package/front_end/models/extensions/ExtensionPanel.ts +24 -24
- package/front_end/models/extensions/ExtensionServer.ts +4 -4
- package/front_end/models/javascript_metadata/NativeFunctions.js +14 -2
- package/front_end/models/persistence/IsolatedFileSystem.ts +18 -19
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +13 -13
- package/front_end/models/trace/EventsSerializer.ts +5 -5
- package/front_end/models/trace/LanternComputationData.ts +10 -10
- package/front_end/models/trace/ModelImpl.ts +32 -54
- package/front_end/models/trace/Processor.ts +28 -30
- package/front_end/models/trace/extras/FilmStrip.ts +6 -6
- package/front_end/models/trace/extras/StackTraceForEvent.ts +22 -25
- package/front_end/models/trace/extras/ThirdParties.ts +16 -17
- package/front_end/models/trace/extras/TraceFilter.ts +1 -1
- package/front_end/models/trace/handlers/Threads.ts +10 -10
- package/front_end/models/trace/handlers/helpers.ts +9 -9
- package/front_end/models/trace/handlers/types.ts +3 -3
- package/front_end/models/trace/insights/CLSCulprits.ts +12 -14
- package/front_end/models/trace/insights/Cache.ts +8 -4
- package/front_end/models/trace/insights/DOMSize.ts +8 -5
- package/front_end/models/trace/insights/DocumentLatency.ts +2 -2
- package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -3
- package/front_end/models/trace/insights/FontDisplay.ts +3 -4
- package/front_end/models/trace/insights/ForcedReflow.ts +3 -3
- package/front_end/models/trace/insights/INPBreakdown.ts +2 -2
- package/front_end/models/trace/insights/ImageDelivery.ts +11 -11
- package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
- package/front_end/models/trace/insights/LCPDiscovery.ts +4 -4
- package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -2
- package/front_end/models/trace/insights/ModernHTTP.ts +4 -5
- package/front_end/models/trace/insights/NetworkDependencyTree.ts +12 -12
- package/front_end/models/trace/insights/RenderBlocking.ts +9 -10
- package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -2
- package/front_end/models/trace/insights/ThirdParties.ts +4 -5
- package/front_end/models/trace/insights/Viewport.ts +8 -5
- package/front_end/models/trace/insights/types.ts +1 -0
- package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +10 -10
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +52 -52
- package/front_end/panels/accessibility/AccessibilitySidebarView.ts +8 -8
- package/front_end/panels/animation/AnimationTimeline.ts +5 -5
- package/front_end/panels/animation/AnimationUI.ts +22 -23
- package/front_end/panels/application/ApplicationPanelSidebar.ts +12 -12
- package/front_end/panels/application/DOMStorageModel.ts +23 -23
- package/front_end/panels/application/ExtensionStorageModel.ts +31 -31
- package/front_end/panels/application/IndexedDBModel.ts +1 -0
- package/front_end/panels/application/PreloadingTreeElement.ts +8 -8
- package/front_end/panels/application/ServiceWorkersView.ts +0 -53
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
- package/front_end/panels/common/BadgeNotification.ts +140 -10
- package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
- package/front_end/panels/common/badgeNotification.css +30 -9
- package/front_end/panels/console/ConsoleContextSelector.ts +9 -9
- package/front_end/panels/console/ConsolePrompt.ts +8 -5
- package/front_end/panels/console/ConsoleView.ts +13 -13
- package/front_end/panels/console/ConsoleViewport.ts +29 -29
- package/front_end/panels/coverage/CoverageModel.ts +22 -22
- package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
- package/front_end/panels/elements/ComputedStyleModel.ts +17 -18
- package/front_end/panels/elements/DOMPath.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +13 -13
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -18
- package/front_end/panels/elements/ElementsTreeOutline.ts +44 -48
- package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
- package/front_end/panels/elements/StylePropertiesSection.ts +7 -4
- package/front_end/panels/elements/StylePropertyTreeElement.ts +54 -50
- package/front_end/panels/elements/StylesSidebarPane.ts +19 -19
- package/front_end/panels/emulation/DeviceModeToolbar.ts +7 -7
- package/front_end/panels/emulation/DeviceModeView.ts +6 -6
- package/front_end/panels/emulation/MediaQueryInspector.ts +18 -18
- package/front_end/panels/event_listeners/EventListenersView.ts +13 -14
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +3 -3
- package/front_end/panels/layer_viewer/LayerViewHost.ts +13 -13
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +9 -10
- package/front_end/panels/layer_viewer/TransformController.ts +34 -36
- package/front_end/panels/layers/LayerTreeModel.ts +41 -40
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +13 -13
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -7
- package/front_end/panels/media/PlayerMessagesView.ts +5 -5
- package/front_end/panels/media/TickingFlameChart.ts +24 -24
- package/front_end/panels/media/TickingFlameChartHelpers.ts +32 -32
- package/front_end/panels/network/NetworkItemView.ts +4 -4
- package/front_end/panels/network/NetworkLogViewColumns.ts +29 -29
- package/front_end/panels/network/NetworkPanel.ts +8 -5
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +10 -10
- package/front_end/panels/profiler/HeapDetachedElementsView.ts +3 -3
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +3 -4
- package/front_end/panels/profiler/ProfileHeader.ts +25 -25
- package/front_end/panels/profiler/ProfileLauncherView.ts +5 -6
- package/front_end/panels/recorder/components/ReplaySection.ts +3 -1
- package/front_end/panels/security/OriginTreeElement.ts +8 -8
- package/front_end/panels/security/SecurityPanel.ts +5 -5
- package/front_end/panels/settings/SettingsScreen.ts +18 -18
- package/front_end/panels/settings/components/SyncSection.ts +26 -8
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
- package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -9
- package/front_end/panels/sources/NavigatorView.ts +43 -46
- package/front_end/panels/sources/SourcesPanel.ts +35 -35
- package/front_end/panels/sources/SourcesView.ts +13 -13
- package/front_end/panels/sources/TabbedEditorContainer.ts +19 -22
- package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +34 -36
- package/front_end/panels/timeline/AnimationsTrackAppender.ts +3 -3
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +8 -8
- package/front_end/panels/timeline/CountersGraph.ts +16 -16
- package/front_end/panels/timeline/EntriesFilter.ts +4 -3
- package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
- package/front_end/panels/timeline/GPUTrackAppender.ts +3 -3
- package/front_end/panels/timeline/Initiators.ts +10 -10
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -5
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +7 -7
- package/front_end/panels/timeline/ModificationsManager.ts +8 -15
- package/front_end/panels/timeline/TargetForEvent.ts +2 -2
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
- package/front_end/panels/timeline/ThreadAppender.ts +13 -13
- package/front_end/panels/timeline/TimelineDetailsView.ts +6 -14
- package/front_end/panels/timeline/TimelineEventOverview.ts +27 -26
- package/front_end/panels/timeline/TimelineFilters.ts +5 -5
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +54 -53
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +34 -34
- package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -31
- package/front_end/panels/timeline/TimelineHistoryManager.ts +17 -18
- package/front_end/panels/timeline/TimelineMiniMap.ts +6 -6
- package/front_end/panels/timeline/TimelinePaintProfilerView.ts +6 -6
- package/front_end/panels/timeline/TimelinePanel.ts +73 -68
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +7 -5
- package/front_end/panels/timeline/TimelineTreeView.ts +10 -10
- package/front_end/panels/timeline/TimelineUIUtils.ts +47 -46
- package/front_end/panels/timeline/TimingsTrackAppender.ts +12 -12
- package/front_end/panels/timeline/TracingLayerTree.ts +43 -43
- package/front_end/panels/timeline/TrackConfigBanner.ts +6 -6
- package/front_end/panels/timeline/TrackConfiguration.ts +1 -1
- package/front_end/panels/timeline/components/DetailsView.ts +4 -4
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +12 -21
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -1
- package/front_end/panels/timeline/components/NetworkRequestDetails.ts +5 -5
- package/front_end/panels/timeline/components/Sidebar.ts +4 -14
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +13 -36
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +21 -19
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/insights/Cache.ts +4 -0
- package/front_end/panels/timeline/components/insights/DOMSize.ts +5 -1
- package/front_end/panels/timeline/components/insights/Helpers.ts +19 -0
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
- package/front_end/panels/timeline/components/insights/Viewport.ts +4 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
- package/front_end/panels/timeline/utils/AICallTree.ts +11 -11
- package/front_end/panels/timeline/utils/AIContext.ts +17 -19
- package/front_end/panels/timeline/utils/EntityMapper.ts +6 -5
- package/front_end/panels/timeline/utils/EntryName.ts +2 -2
- package/front_end/panels/timeline/utils/EntryNodes.ts +5 -5
- package/front_end/panels/timeline/utils/EntryStyles.ts +4 -4
- package/front_end/panels/timeline/utils/FreshRecording.ts +3 -3
- package/front_end/panels/timeline/utils/Helpers.ts +0 -18
- package/front_end/panels/timeline/utils/InsightAIContext.ts +6 -6
- package/front_end/panels/timeline/utils/SourceMapsResolver.ts +7 -7
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/third_party/json5/rebuild.sh +1 -1
- package/front_end/third_party/legacy-javascript/{update.sh → rebuild.sh} +1 -1
- package/front_end/third_party/lit/lib/decorators.d.ts +26 -9
- package/front_end/third_party/lit/lib/decorators.js +5 -5
- package/front_end/third_party/lit/lib/decorators.js.map +1 -1
- package/front_end/third_party/lit/lib/directive.js.map +1 -1
- package/front_end/third_party/lit/lib/directives.js +8 -13
- package/front_end/third_party/lit/lib/directives.js.map +1 -1
- package/front_end/third_party/lit/lib/lit.d.ts +26 -9
- package/front_end/third_party/lit/lib/lit.js +5 -5
- package/front_end/third_party/lit/lib/lit.js.map +1 -1
- package/front_end/third_party/lit/lib/static-html.js +2 -2
- package/front_end/third_party/lit/lib/static-html.js.map +1 -1
- package/front_end/third_party/lit/rebuild.sh +1 -1
- package/front_end/third_party/third-party-web/rebuild.sh +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +6 -7
- package/front_end/ui/legacy/ActionRegistration.ts +9 -9
- package/front_end/ui/legacy/DockController.ts +18 -18
- package/front_end/ui/legacy/FilterBar.ts +7 -7
- package/front_end/ui/legacy/Fragment.ts +4 -4
- package/front_end/ui/legacy/GlassPane.ts +12 -12
- package/front_end/ui/legacy/InspectorView.ts +5 -15
- package/front_end/ui/legacy/ListControl.ts +27 -27
- package/front_end/ui/legacy/ListWidget.ts +4 -4
- package/front_end/ui/legacy/PopoverHelper.ts +4 -4
- package/front_end/ui/legacy/ShortcutRegistry.ts +17 -17
- package/front_end/ui/legacy/TabbedPane.ts +74 -75
- package/front_end/ui/legacy/TextPrompt.ts +31 -31
- package/front_end/ui/legacy/Toolbar.ts +13 -14
- package/front_end/ui/legacy/ViewManager.ts +30 -31
- package/front_end/ui/legacy/Widget.ts +6 -6
- package/front_end/ui/legacy/XLink.ts +9 -9
- package/front_end/ui/legacy/ZoomManager.ts +9 -9
- package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +27 -27
- package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +30 -32
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +15 -15
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -11
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +12 -12
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -3
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +14 -14
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -8
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -5
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +4 -4
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +1 -1
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/theme_support/ThemeSupport.ts +4 -4
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
- package/package.json +1 -1
- package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -9,17 +9,17 @@ import type {ConversationSuggestion} from '../agents/AiAgent.js';
|
|
9
9
|
import {
|
10
10
|
NetworkRequestFormatter,
|
11
11
|
} from './NetworkRequestFormatter.js';
|
12
|
-
import
|
12
|
+
import {bytes, micros, millis} from './UnitFormatters.js';
|
13
13
|
|
14
14
|
/**
|
15
15
|
* For a given frame ID and navigation ID, returns the LCP Event and the LCP Request, if the resource was an image.
|
16
16
|
*/
|
17
|
-
function getLCPData(parsedTrace: Trace.
|
17
|
+
function getLCPData(parsedTrace: Trace.TraceModel.ParsedTrace, frameId: string, navigationId: string): {
|
18
18
|
lcpEvent: Trace.Types.Events.LargestContentfulPaintCandidate,
|
19
19
|
metricScore: Trace.Handlers.ModelHandlers.PageLoadMetrics.LCPMetricScore,
|
20
20
|
lcpRequest?: Trace.Types.Events.SyntheticNetworkRequest,
|
21
21
|
}|null {
|
22
|
-
const navMetrics = parsedTrace.PageLoadMetrics.metricScoresByFrameId.get(frameId)?.get(navigationId);
|
22
|
+
const navMetrics = parsedTrace.data.PageLoadMetrics.metricScoresByFrameId.get(frameId)?.get(navigationId);
|
23
23
|
if (!navMetrics) {
|
24
24
|
return null;
|
25
25
|
}
|
@@ -35,29 +35,25 @@ function getLCPData(parsedTrace: Trace.Handlers.Types.ParsedTrace, frameId: stri
|
|
35
35
|
|
36
36
|
return {
|
37
37
|
lcpEvent,
|
38
|
-
lcpRequest: parsedTrace.LargestImagePaint.lcpRequestByNavigationId.get(navigationId),
|
38
|
+
lcpRequest: parsedTrace.data.LargestImagePaint.lcpRequestByNavigationId.get(navigationId),
|
39
39
|
metricScore: metric,
|
40
40
|
};
|
41
41
|
}
|
42
42
|
|
43
43
|
export class PerformanceInsightFormatter {
|
44
44
|
#insight: Trace.Insights.Types.InsightModel;
|
45
|
-
#parsedTrace: Trace.
|
46
|
-
#unitFormatters: UnitFormatters;
|
45
|
+
#parsedTrace: Trace.TraceModel.ParsedTrace;
|
47
46
|
|
48
|
-
constructor(
|
49
|
-
formatters: UnitFormatters, parsedTrace: Trace.Handlers.Types.ParsedTrace,
|
50
|
-
insight: Trace.Insights.Types.InsightModel) {
|
47
|
+
constructor(parsedTrace: Trace.TraceModel.ParsedTrace, insight: Trace.Insights.Types.InsightModel) {
|
51
48
|
this.#insight = insight;
|
52
49
|
this.#parsedTrace = parsedTrace;
|
53
|
-
this.#unitFormatters = formatters;
|
54
50
|
}
|
55
51
|
|
56
52
|
#formatMilli(x?: number): string {
|
57
53
|
if (x === undefined) {
|
58
54
|
return '';
|
59
55
|
}
|
60
|
-
return
|
56
|
+
return millis(x);
|
61
57
|
}
|
62
58
|
|
63
59
|
#formatMicro(x?: number): string {
|
@@ -94,8 +90,7 @@ export class PerformanceInsightFormatter {
|
|
94
90
|
if (lcpRequest) {
|
95
91
|
parts.push(`${theLcpElement} is an image fetched from \`${lcpRequest.args.data.url}\`.`);
|
96
92
|
const request = TraceEventFormatter.networkRequests(
|
97
|
-
|
98
|
-
{verbose: true, customTitle: 'LCP resource network request'});
|
93
|
+
[lcpRequest], this.#parsedTrace, {verbose: true, customTitle: 'LCP resource network request'});
|
99
94
|
parts.push(request);
|
100
95
|
} else {
|
101
96
|
parts.push(`${theLcpElement} is text and was not fetched from the network.`);
|
@@ -186,6 +181,87 @@ export class PerformanceInsightFormatter {
|
|
186
181
|
}
|
187
182
|
}
|
188
183
|
|
184
|
+
/**
|
185
|
+
* Create an AI prompt string out of the Cache Insight model to use with Ask AI.
|
186
|
+
* Note: This function accesses the UIStrings within Cache to help build the
|
187
|
+
* AI prompt, but does not (and should not) call i18nString to localize these strings. They
|
188
|
+
* should all be sent in English (at least for now).
|
189
|
+
* @param insight The Cache Insight Model to query.
|
190
|
+
* @returns a string formatted for sending to Ask AI.
|
191
|
+
*/
|
192
|
+
formatCacheInsight(insight: Trace.Insights.Models.Cache.CacheInsightModel): string {
|
193
|
+
if (insight.requests.length === 0) {
|
194
|
+
return Trace.Insights.Models.Cache.UIStrings.noRequestsToCache + '.';
|
195
|
+
}
|
196
|
+
|
197
|
+
let output = 'The following resources were associated with ineffficient cache policies:\n';
|
198
|
+
|
199
|
+
for (const entry of insight.requests) {
|
200
|
+
output += `\n- ${entry.request.args.data.url}`;
|
201
|
+
output += `\n - Cache Time to Live (TTL): ${entry.ttl} seconds`;
|
202
|
+
output += `\n - Wasted bytes: ${bytes(entry.wastedBytes)}`;
|
203
|
+
}
|
204
|
+
|
205
|
+
output += '\n\n' + Trace.Insights.Models.Cache.UIStrings.description;
|
206
|
+
return output;
|
207
|
+
}
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Create an AI prompt string out of the DOM Size model to use with Ask AI.
|
211
|
+
* Note: This function accesses the UIStrings within DomSize to help build the
|
212
|
+
* AI prompt, but does not (and should not) call i18nString to localize these strings. They
|
213
|
+
* should all be sent in English (at least for now).
|
214
|
+
* @param insight The DOM Size Insight Model to query.
|
215
|
+
* @returns a string formatted for sending to Ask AI.
|
216
|
+
*/
|
217
|
+
formatDomSizeInsight(insight: Trace.Insights.Models.DOMSize.DOMSizeInsightModel): string {
|
218
|
+
if (insight.state === 'pass') {
|
219
|
+
return 'No DOM size issues were detected.';
|
220
|
+
}
|
221
|
+
|
222
|
+
let output = Trace.Insights.Models.DOMSize.UIStrings.description + '\n';
|
223
|
+
|
224
|
+
if (insight.maxDOMStats) {
|
225
|
+
output += '\n' + Trace.Insights.Models.DOMSize.UIStrings.statistic + ':\n\n';
|
226
|
+
|
227
|
+
const maxDepthStats = insight.maxDOMStats.args.data.maxDepth;
|
228
|
+
const maxChildrenStats = insight.maxDOMStats.args.data.maxChildren;
|
229
|
+
output += Trace.Insights.Models.DOMSize.UIStrings.totalElements + ': ' +
|
230
|
+
insight.maxDOMStats.args.data.totalElements + '.\n';
|
231
|
+
if (maxDepthStats) {
|
232
|
+
output += Trace.Insights.Models.DOMSize.UIStrings.maxDOMDepth + ': ' + maxDepthStats.depth +
|
233
|
+
` nodes, starting with element '${maxDepthStats.nodeName}'` +
|
234
|
+
' (node id: ' + maxDepthStats.nodeId + ').\n';
|
235
|
+
}
|
236
|
+
if (maxChildrenStats) {
|
237
|
+
output += Trace.Insights.Models.DOMSize.UIStrings.maxChildren + ': ' + maxChildrenStats.numChildren +
|
238
|
+
`, for parent '${maxChildrenStats.nodeName}'` +
|
239
|
+
' (node id: ' + maxChildrenStats.nodeId + ').\n';
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
if (insight.largeLayoutUpdates.length > 0 || insight.largeStyleRecalcs.length > 0) {
|
244
|
+
output += `\nLarge layout updates/style calculations:\n`;
|
245
|
+
}
|
246
|
+
|
247
|
+
if (insight.largeLayoutUpdates.length > 0) {
|
248
|
+
for (const update of insight.largeLayoutUpdates) {
|
249
|
+
output += `\n - Layout update: Duration: ${this.#formatMicro(update.dur)},`;
|
250
|
+
output += ` with ${update.args.beginData.dirtyObjects} of ${
|
251
|
+
update.args.beginData.totalObjects} nodes needing layout.`;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
if (insight.largeStyleRecalcs.length > 0) {
|
256
|
+
for (const recalc of insight.largeStyleRecalcs) {
|
257
|
+
output += `\n - Style recalculation: Duration: ${this.#formatMicro(recalc.dur)}, `;
|
258
|
+
output += `with ${recalc.args.elementCount} elements affected.`;
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
return output;
|
263
|
+
}
|
264
|
+
|
189
265
|
/**
|
190
266
|
* Create an AI prompt string out of the NetworkDependencyTree Insight model to use with Ask AI.
|
191
267
|
* Note: This function accesses the UIStrings within NetworkDependencyTree to help build the
|
@@ -417,7 +493,7 @@ export class PerformanceInsightFormatter {
|
|
417
493
|
output += `The following list contains the largest transfer sizes by a 3rd party script:\n\n`;
|
418
494
|
for (const entry of thirdPartyTransferSizeEntries) {
|
419
495
|
if (entry.transferSize > 0) {
|
420
|
-
output += `- ${entry.entity.name}: ${
|
496
|
+
output += `- ${entry.entity.name}: ${bytes(entry.transferSize)}\n`;
|
421
497
|
}
|
422
498
|
}
|
423
499
|
output += '\n';
|
@@ -437,6 +513,32 @@ export class PerformanceInsightFormatter {
|
|
437
513
|
return output;
|
438
514
|
}
|
439
515
|
|
516
|
+
/**
|
517
|
+
* Create an AI prompt string out of the Viewport [Mobile] Insight model to use with Ask AI.
|
518
|
+
* Note: This function accesses the UIStrings within Viewport to help build the
|
519
|
+
* AI prompt, but does not (and should not) call i18nString to localize these strings. They
|
520
|
+
* should all be sent in English (at least for now).
|
521
|
+
* @param insight The Network Dependency Tree Insight Model to query.
|
522
|
+
* @returns a string formatted for sending to Ask AI.
|
523
|
+
*/
|
524
|
+
formatViewportInsight(insight: Trace.Insights.Models.Viewport.ViewportInsightModel): string {
|
525
|
+
let output = '';
|
526
|
+
|
527
|
+
output += 'The webpage is ' + (insight.mobileOptimized ? 'already' : 'not') + ' optimized for mobile viewing.\n';
|
528
|
+
|
529
|
+
const hasMetaTag = insight.viewportEvent;
|
530
|
+
if (hasMetaTag) {
|
531
|
+
output += `\nThe viewport meta tag was found: \`${insight.viewportEvent?.args?.data.content}\`.`;
|
532
|
+
} else {
|
533
|
+
output += `\nThe viewport meta tag is missing.`;
|
534
|
+
}
|
535
|
+
|
536
|
+
if (!hasMetaTag) {
|
537
|
+
output += '\n\n' + Trace.Insights.Models.Viewport.UIStrings.description;
|
538
|
+
}
|
539
|
+
return output;
|
540
|
+
}
|
541
|
+
|
440
542
|
/**
|
441
543
|
* Formats and outputs the insight's data.
|
442
544
|
* Pass `{headingLevel: X}` to determine what heading level to use for the
|
@@ -475,18 +577,18 @@ ${this.#links()}`;
|
|
475
577
|
.map(optimization => {
|
476
578
|
const message =
|
477
579
|
Trace.Insights.Models.ImageDelivery.getOptimizationMessage(optimization);
|
478
|
-
const byteSavings =
|
580
|
+
const byteSavings = bytes(optimization.byteSavings);
|
479
581
|
return `${message} (Est ${byteSavings})`;
|
480
582
|
})
|
481
583
|
.join('\n');
|
482
584
|
|
483
585
|
return `### ${image.request.args.data.url}
|
484
|
-
- Potential savings: ${
|
586
|
+
- Potential savings: ${bytes(image.byteSavings)}
|
485
587
|
- Optimizations:\n${optimizations}`;
|
486
588
|
})
|
487
589
|
.join('\n\n');
|
488
590
|
|
489
|
-
return `Total potential savings: ${
|
591
|
+
return `Total potential savings: ${bytes(this.#insight.wastedBytes)}
|
490
592
|
|
491
593
|
The following images could be optimized:\n\n${imageDetails}`;
|
492
594
|
}
|
@@ -546,8 +648,8 @@ ${checklistBulletPoints.map(point => `- ${point.name}: ${point.passed ? 'PASSED'
|
|
546
648
|
}
|
547
649
|
|
548
650
|
if (Trace.Insights.Models.RenderBlocking.isRenderBlocking(this.#insight)) {
|
549
|
-
const requestSummary =
|
550
|
-
this.#
|
651
|
+
const requestSummary =
|
652
|
+
TraceEventFormatter.networkRequests(this.#insight.renderBlockingRequests, this.#parsedTrace);
|
551
653
|
|
552
654
|
if (requestSummary.length === 0) {
|
553
655
|
return 'There are no network requests that are render blocking.';
|
@@ -582,7 +684,7 @@ ${requestSummary}`;
|
|
582
684
|
|
583
685
|
return `${this.#lcpMetricSharedContext()}
|
584
686
|
|
585
|
-
${TraceEventFormatter.networkRequests(
|
687
|
+
${TraceEventFormatter.networkRequests([documentRequest], this.#parsedTrace, {
|
586
688
|
verbose: true,
|
587
689
|
customTitle: 'Document network request'
|
588
690
|
})}
|
@@ -614,7 +716,7 @@ ${checklistBulletPoints.map(point => `- ${point.name}: ${point.passed ? 'PASSED'
|
|
614
716
|
return '';
|
615
717
|
}
|
616
718
|
|
617
|
-
const baseTime = this.#parsedTrace.Meta.traceBounds.min;
|
719
|
+
const baseTime = this.#parsedTrace.data.Meta.traceBounds.min;
|
618
720
|
|
619
721
|
const clusterTimes = {
|
620
722
|
start: worstCluster.ts - baseTime,
|
@@ -622,8 +724,7 @@ ${checklistBulletPoints.map(point => `- ${point.name}: ${point.passed ? 'PASSED'
|
|
622
724
|
} as const;
|
623
725
|
|
624
726
|
const shiftsFormatted = worstCluster.events.map((layoutShift, index) => {
|
625
|
-
return TraceEventFormatter.layoutShift(
|
626
|
-
this.#unitFormatters, layoutShift, index, this.#parsedTrace, shifts.get(layoutShift));
|
727
|
+
return TraceEventFormatter.layoutShift(layoutShift, index, this.#parsedTrace, shifts.get(layoutShift));
|
627
728
|
});
|
628
729
|
|
629
730
|
return `The worst layout shift cluster was the cluster that started at ${
|
@@ -637,9 +738,8 @@ ${shiftsFormatted.join('\n')}`;
|
|
637
738
|
|
638
739
|
if (Trace.Insights.Models.ModernHTTP.isModernHTTP(this.#insight)) {
|
639
740
|
const requestSummary = (this.#insight.http1Requests.length === 1) ?
|
640
|
-
TraceEventFormatter.networkRequests(
|
641
|
-
|
642
|
-
TraceEventFormatter.networkRequests(this.#unitFormatters, this.#insight.http1Requests, this.#parsedTrace);
|
741
|
+
TraceEventFormatter.networkRequests(this.#insight.http1Requests, this.#parsedTrace, {verbose: true}) :
|
742
|
+
TraceEventFormatter.networkRequests(this.#insight.http1Requests, this.#parsedTrace);
|
643
743
|
|
644
744
|
if (requestSummary.length === 0) {
|
645
745
|
return 'There are no requests that were served over a legacy HTTP protocol.';
|
@@ -689,6 +789,14 @@ Legacy JavaScript by file:
|
|
689
789
|
${filesFormatted}`;
|
690
790
|
}
|
691
791
|
|
792
|
+
if (Trace.Insights.Models.Cache.isCacheInsight(this.#insight)) {
|
793
|
+
return this.formatCacheInsight(this.#insight);
|
794
|
+
}
|
795
|
+
|
796
|
+
if (Trace.Insights.Models.DOMSize.isDomSizeInsight(this.#insight)) {
|
797
|
+
return this.formatDomSizeInsight(this.#insight);
|
798
|
+
}
|
799
|
+
|
692
800
|
if (Trace.Insights.Models.FontDisplay.isFontDisplayInsight(this.#insight)) {
|
693
801
|
return this.formatFontDisplayInsight(this.#insight);
|
694
802
|
}
|
@@ -709,6 +817,10 @@ ${filesFormatted}`;
|
|
709
817
|
return this.formatThirdPartiesInsight(this.#insight);
|
710
818
|
}
|
711
819
|
|
820
|
+
if (Trace.Insights.Models.Viewport.isViewportInsight(this.#insight)) {
|
821
|
+
return this.formatViewportInsight(this.#insight);
|
822
|
+
}
|
823
|
+
|
712
824
|
return '';
|
713
825
|
}
|
714
826
|
|
@@ -731,7 +843,7 @@ ${filesFormatted}`;
|
|
731
843
|
case 'DocumentLatency':
|
732
844
|
return '- https://web.dev/articles/optimize-ttfb';
|
733
845
|
case 'DOMSize':
|
734
|
-
return '';
|
846
|
+
return '- https://developer.chrome.com/docs/lighthouse/performance/dom-size/';
|
735
847
|
case 'DuplicatedJavaScript':
|
736
848
|
return '';
|
737
849
|
case 'FontDisplay':
|
@@ -764,9 +876,9 @@ ${filesFormatted}`;
|
|
764
876
|
case 'ThirdParties':
|
765
877
|
return '- https://web.dev/articles/optimizing-content-efficiency-loading-third-party-javascript/';
|
766
878
|
case 'Viewport':
|
767
|
-
return '';
|
879
|
+
return '- https://developer.chrome.com/blog/300ms-tap-delay-gone-away/';
|
768
880
|
case 'Cache':
|
769
|
-
return '';
|
881
|
+
return '- https://web.dev/uses-long-cache-ttl/';
|
770
882
|
case 'ModernHTTP':
|
771
883
|
return '- https://developer.chrome.com/docs/lighthouse/best-practices/uses-http2';
|
772
884
|
case 'LegacyJavaScript':
|
@@ -788,7 +900,11 @@ ${filesFormatted}`;
|
|
788
900
|
2. Did the server respond in 600ms or less? We want developers to aim for as close to 100ms as possible, but our threshold for this insight is 600ms.
|
789
901
|
3. Was there compression applied to the response to minimize the transfer size?`;
|
790
902
|
case 'DOMSize':
|
791
|
-
return
|
903
|
+
return `This insight evaluates some key metrics about the Document Object Model (DOM) and identifies excess in the DOM tree, for example:
|
904
|
+
- The maximum number of elements within the DOM.
|
905
|
+
- The maximum number of children for any given element.
|
906
|
+
- Excessive depth of the DOM structure.
|
907
|
+
- The largest layout and style recalculation events.`;
|
792
908
|
case 'DuplicatedJavaScript':
|
793
909
|
return `This insight identifies large, duplicated JavaScript modules that are present in your application and create redundant code.
|
794
910
|
This wastes network bandwidth and slows down your page, as the user's browser must download and process the same code multiple times.`;
|
@@ -834,9 +950,9 @@ It is important that all of these checks pass to minimize the delay between the
|
|
834
950
|
case 'ThirdParties':
|
835
951
|
return 'This insight analyzes the performance impact of resources loaded from third-party servers and aggregates the performance cost, in terms of download transfer sizes and total amount of time that third party scripts spent executing on the main thread.';
|
836
952
|
case 'Viewport':
|
837
|
-
return '';
|
953
|
+
return 'The insight identifies web pages that are not specifying the viewport meta tag for mobile devies, which avoids the artificial 300-350ms delay designed to help differentiate between tap and double-click.';
|
838
954
|
case 'Cache':
|
839
|
-
return '';
|
955
|
+
return 'This insight identifies static resources that are not cached effectively by the browser.';
|
840
956
|
case 'ModernHTTP':
|
841
957
|
return `Modern HTTP protocols, such as HTTP/2, are more efficient than older versions like HTTP/1.1 because they allow for multiple requests and responses to be sent over a single network connection, significantly improving page load performance by reducing latency and overhead. This insight identifies requests that can be upgraded to a modern HTTP protocol.
|
842
958
|
|
@@ -861,10 +977,9 @@ export interface NetworkRequestFormatOptions {
|
|
861
977
|
|
862
978
|
export class TraceEventFormatter {
|
863
979
|
static layoutShift(
|
864
|
-
|
865
|
-
parsedTrace: Trace.Handlers.Types.ParsedTrace,
|
980
|
+
shift: Trace.Types.Events.SyntheticLayoutShift, index: number, parsedTrace: Trace.TraceModel.ParsedTrace,
|
866
981
|
rootCauses?: Trace.Insights.Models.CLSCulprits.LayoutShiftRootCausesData): string {
|
867
|
-
const baseTime = parsedTrace.Meta.traceBounds.min;
|
982
|
+
const baseTime = parsedTrace.data.Meta.traceBounds.min;
|
868
983
|
|
869
984
|
const potentialRootCauses: string[] = [];
|
870
985
|
if (rootCauses) {
|
@@ -896,15 +1011,15 @@ export class TraceEventFormatter {
|
|
896
1011
|
|
897
1012
|
const startTime = Trace.Helpers.Timing.microToMilli(Trace.Types.Timing.Micro(shift.ts - baseTime));
|
898
1013
|
return `### Layout shift ${index + 1}:
|
899
|
-
- Start time: ${
|
1014
|
+
- Start time: ${millis(startTime)}
|
900
1015
|
- Score: ${shift.args.data?.weighted_score_delta.toFixed(4)}
|
901
1016
|
${rootCauseText}`;
|
902
1017
|
}
|
903
1018
|
|
904
1019
|
// Stringify network requests for the LLM model.
|
905
1020
|
static networkRequests(
|
906
|
-
|
907
|
-
|
1021
|
+
requests: readonly Trace.Types.Events.SyntheticNetworkRequest[], parsedTrace: Trace.TraceModel.ParsedTrace,
|
1022
|
+
options?: NetworkRequestFormatOptions): string {
|
908
1023
|
if (requests.length === 0) {
|
909
1024
|
return '';
|
910
1025
|
}
|
@@ -921,12 +1036,11 @@ ${rootCauseText}`;
|
|
921
1036
|
// For a single request, use `formatRequestVerbosely`, which formats with all fields specified and does not require a
|
922
1037
|
// format description.
|
923
1038
|
if (verbose) {
|
924
|
-
return requests
|
925
|
-
.map(request => this.#networkRequestVerbosely(formatters, request, parsedTrace, options?.customTitle))
|
1039
|
+
return requests.map(request => this.#networkRequestVerbosely(request, parsedTrace, options?.customTitle))
|
926
1040
|
.join('\n');
|
927
1041
|
}
|
928
1042
|
|
929
|
-
return this.#networkRequestsArrayCompressed(
|
1043
|
+
return this.#networkRequestsArrayCompressed(requests, parsedTrace);
|
930
1044
|
}
|
931
1045
|
|
932
1046
|
/**
|
@@ -938,8 +1052,8 @@ ${rootCauseText}`;
|
|
938
1052
|
* talk to jacktfranklin@.
|
939
1053
|
*/
|
940
1054
|
static #networkRequestVerbosely(
|
941
|
-
|
942
|
-
|
1055
|
+
request: Trace.Types.Events.SyntheticNetworkRequest, parsedTrace: Trace.TraceModel.ParsedTrace,
|
1056
|
+
customTitle?: string): string {
|
943
1057
|
const {
|
944
1058
|
url,
|
945
1059
|
statusCode,
|
@@ -959,9 +1073,9 @@ ${rootCauseText}`;
|
|
959
1073
|
const navigationForEvent = Trace.Helpers.Trace.getNavigationForTraceEvent(
|
960
1074
|
request,
|
961
1075
|
request.args.data.frame,
|
962
|
-
parsedTrace.Meta.navigationsByFrameId,
|
1076
|
+
parsedTrace.data.Meta.navigationsByFrameId,
|
963
1077
|
);
|
964
|
-
const baseTime = navigationForEvent?.ts ?? parsedTrace.Meta.traceBounds.min;
|
1078
|
+
const baseTime = navigationForEvent?.ts ?? parsedTrace.data.Meta.traceBounds.min;
|
965
1079
|
|
966
1080
|
// Gets all the timings for this request, relative to the base time.
|
967
1081
|
// Note that this is the start time, not total time. E.g. "queuedAt: X"
|
@@ -978,7 +1092,7 @@ ${rootCauseText}`;
|
|
978
1092
|
const downloadTime = syntheticData.finishTime - syntheticData.downloadStart;
|
979
1093
|
|
980
1094
|
const renderBlocking = Trace.Helpers.Network.isSyntheticNetworkRequestEventRenderBlocking(request);
|
981
|
-
const initiator = parsedTrace.NetworkRequests.eventToInitiator.get(request);
|
1095
|
+
const initiator = parsedTrace.data.NetworkRequests.eventToInitiator.get(request);
|
982
1096
|
|
983
1097
|
const priorityLines = [];
|
984
1098
|
if (initialPriority === priority) {
|
@@ -991,8 +1105,8 @@ ${rootCauseText}`;
|
|
991
1105
|
const redirects = request.args.data.redirects.map((redirect, index) => {
|
992
1106
|
const startTime = redirect.ts - baseTime;
|
993
1107
|
return `#### Redirect ${index + 1}: ${redirect.url}
|
994
|
-
- Start time: ${
|
995
|
-
- Duration: ${
|
1108
|
+
- Start time: ${micros(startTime)}
|
1109
|
+
- Duration: ${micros(redirect.dur)}`;
|
996
1110
|
});
|
997
1111
|
|
998
1112
|
const initiators = this.#getInitiatorChain(parsedTrace, request);
|
@@ -1000,14 +1114,14 @@ ${rootCauseText}`;
|
|
1000
1114
|
|
1001
1115
|
return `${titlePrefix}: ${url}
|
1002
1116
|
Timings:
|
1003
|
-
- Queued at: ${
|
1004
|
-
- Request sent at: ${
|
1005
|
-
- Download complete at: ${
|
1006
|
-
- Main thread processing completed at: ${
|
1117
|
+
- Queued at: ${micros(startTimesForLifecycle.queuedAt)}
|
1118
|
+
- Request sent at: ${micros(startTimesForLifecycle.requestSentAt)}
|
1119
|
+
- Download complete at: ${micros(startTimesForLifecycle.downloadCompletedAt)}
|
1120
|
+
- Main thread processing completed at: ${micros(startTimesForLifecycle.processingCompletedAt)}
|
1007
1121
|
Durations:
|
1008
|
-
- Download time: ${
|
1009
|
-
- Main thread processing time: ${
|
1010
|
-
- Total duration: ${
|
1122
|
+
- Download time: ${micros(downloadTime)}
|
1123
|
+
- Main thread processing time: ${micros(mainThreadProcessingDuration)}
|
1124
|
+
- Total duration: ${micros(request.dur)}${initiator ? `\nInitiator: ${initiator.args.data.url}` : ''}
|
1011
1125
|
Redirects:${redirects.length ? '\n' + redirects.join('\n') : ' no redirects'}
|
1012
1126
|
Status code: ${statusCode}
|
1013
1127
|
MIME Type: ${mimeType}
|
@@ -1037,8 +1151,8 @@ ${NetworkRequestFormatter.formatHeaders('Response headers', responseHeaders ?? [
|
|
1037
1151
|
// For a single request, use `formatRequestVerbosely`, which formats with all fields specified and does not require a
|
1038
1152
|
// format description.
|
1039
1153
|
static #networkRequestsArrayCompressed(
|
1040
|
-
|
1041
|
-
parsedTrace: Trace.
|
1154
|
+
requests: readonly Trace.Types.Events.SyntheticNetworkRequest[],
|
1155
|
+
parsedTrace: Trace.TraceModel.ParsedTrace): string {
|
1042
1156
|
const networkDataString = `
|
1043
1157
|
Network requests data:
|
1044
1158
|
|
@@ -1048,7 +1162,7 @@ Network requests data:
|
|
1048
1162
|
requests
|
1049
1163
|
.map(request => {
|
1050
1164
|
const urlIndex = TraceEventFormatter.#getOrAssignUrlIndex(urlIdToIndex, request.args.data.url);
|
1051
|
-
return this.#networkRequestCompressedFormat(
|
1165
|
+
return this.#networkRequestCompressedFormat(urlIndex, request, parsedTrace, urlIdToIndex);
|
1052
1166
|
})
|
1053
1167
|
.join('\n');
|
1054
1168
|
|
@@ -1104,8 +1218,8 @@ The order of headers corresponds to an internal fixed list. If a header is not p
|
|
1104
1218
|
* See `networkDataFormatDescription` above for specifics.
|
1105
1219
|
*/
|
1106
1220
|
static #networkRequestCompressedFormat(
|
1107
|
-
|
1108
|
-
|
1221
|
+
urlIndex: number, request: Trace.Types.Events.SyntheticNetworkRequest, parsedTrace: Trace.TraceModel.ParsedTrace,
|
1222
|
+
urlIdToIndex: Map<string, number>): string {
|
1109
1223
|
const {
|
1110
1224
|
statusCode,
|
1111
1225
|
initialPriority,
|
@@ -1120,16 +1234,16 @@ The order of headers corresponds to an internal fixed list. If a header is not p
|
|
1120
1234
|
const navigationForEvent = Trace.Helpers.Trace.getNavigationForTraceEvent(
|
1121
1235
|
request,
|
1122
1236
|
request.args.data.frame,
|
1123
|
-
parsedTrace.Meta.navigationsByFrameId,
|
1237
|
+
parsedTrace.data.Meta.navigationsByFrameId,
|
1124
1238
|
);
|
1125
|
-
const baseTime = navigationForEvent?.ts ?? parsedTrace.Meta.traceBounds.min;
|
1126
|
-
const queuedTime =
|
1127
|
-
const requestSentTime =
|
1128
|
-
const downloadCompleteTime =
|
1129
|
-
const processingCompleteTime =
|
1130
|
-
const totalDuration =
|
1131
|
-
const downloadDuration =
|
1132
|
-
const mainThreadProcessingDuration =
|
1239
|
+
const baseTime = navigationForEvent?.ts ?? parsedTrace.data.Meta.traceBounds.min;
|
1240
|
+
const queuedTime = micros(request.ts - baseTime);
|
1241
|
+
const requestSentTime = micros(syntheticData.sendStartTime - baseTime);
|
1242
|
+
const downloadCompleteTime = micros(syntheticData.finishTime - baseTime);
|
1243
|
+
const processingCompleteTime = micros(request.ts + request.dur - baseTime);
|
1244
|
+
const totalDuration = micros(request.dur);
|
1245
|
+
const downloadDuration = micros(syntheticData.finishTime - syntheticData.downloadStart);
|
1246
|
+
const mainThreadProcessingDuration = micros(request.ts + request.dur - syntheticData.finishTime);
|
1133
1247
|
const renderBlocking = Trace.Helpers.Network.isSyntheticNetworkRequestEventRenderBlocking(request) ? 't' : 'f';
|
1134
1248
|
const finalPriority = priority;
|
1135
1249
|
const headerValues = responseHeaders
|
@@ -1142,8 +1256,8 @@ The order of headers corresponds to an internal fixed list. If a header is not p
|
|
1142
1256
|
const redirects = request.args.data.redirects
|
1143
1257
|
.map(redirect => {
|
1144
1258
|
const urlIndex = TraceEventFormatter.#getOrAssignUrlIndex(urlIdToIndex, redirect.url);
|
1145
|
-
const redirectStartTime =
|
1146
|
-
const redirectDuration =
|
1259
|
+
const redirectStartTime = micros(redirect.ts - baseTime);
|
1260
|
+
const redirectDuration = micros(redirect.dur);
|
1147
1261
|
return `[${urlIndex}|${redirectStartTime}|${redirectDuration}]`;
|
1148
1262
|
})
|
1149
1263
|
.join(',');
|
@@ -1177,13 +1291,13 @@ The order of headers corresponds to an internal fixed list. If a header is not p
|
|
1177
1291
|
}
|
1178
1292
|
|
1179
1293
|
static #getInitiatorChain(
|
1180
|
-
parsedTrace: Trace.
|
1294
|
+
parsedTrace: Trace.TraceModel.ParsedTrace,
|
1181
1295
|
request: Trace.Types.Events.SyntheticNetworkRequest): Trace.Types.Events.SyntheticNetworkRequest[] {
|
1182
1296
|
const initiators: Trace.Types.Events.SyntheticNetworkRequest[] = [];
|
1183
1297
|
|
1184
1298
|
let cur: Trace.Types.Events.SyntheticNetworkRequest|undefined = request;
|
1185
1299
|
while (cur) {
|
1186
|
-
const initiator = parsedTrace.NetworkRequests.eventToInitiator.get(cur);
|
1300
|
+
const initiator = parsedTrace.data.NetworkRequests.eventToInitiator.get(cur);
|
1187
1301
|
if (initiator) {
|
1188
1302
|
// Should never happen, but if it did that would be an infinite loop.
|
1189
1303
|
if (initiators.includes(initiator)) {
|