devtools-tracing 1.1.0 → 1.2.0
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/.claude/settings.local.json +14 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +28854 -0
- package/package.json +10 -8
- package/generate.ts +0 -649
- package/index.ts +0 -17
- package/lib/extension-api/ExtensionAPI.d.ts +0 -357
- package/lib/front_end/core/common/App.ts +0 -7
- package/lib/front_end/core/common/AppProvider.ts +0 -32
- package/lib/front_end/core/common/Base64.ts +0 -47
- package/lib/front_end/core/common/CharacterIdMap.ts +0 -30
- package/lib/front_end/core/common/Color.ts +0 -2506
- package/lib/front_end/core/common/ColorConverter.ts +0 -402
- package/lib/front_end/core/common/ColorUtils.ts +0 -252
- package/lib/front_end/core/common/Console.ts +0 -114
- package/lib/front_end/core/common/Debouncer.ts +0 -15
- package/lib/front_end/core/common/EventTarget.ts +0 -52
- package/lib/front_end/core/common/Gzip.ts +0 -74
- package/lib/front_end/core/common/JavaScriptMetaData.ts +0 -29
- package/lib/front_end/core/common/Lazy.ts +0 -31
- package/lib/front_end/core/common/Linkifier.ts +0 -55
- package/lib/front_end/core/common/MapWithDefault.ts +0 -26
- package/lib/front_end/core/common/Mutex.ts +0 -55
- package/lib/front_end/core/common/Object.ts +0 -145
- package/lib/front_end/core/common/ParsedURL.ts +0 -554
- package/lib/front_end/core/common/Progress.ts +0 -180
- package/lib/front_end/core/common/QueryParamHandler.ts +0 -7
- package/lib/front_end/core/common/ResolverBase.ts +0 -85
- package/lib/front_end/core/common/ResourceType.ts +0 -588
- package/lib/front_end/core/common/ReturnToPanel.ts +0 -17
- package/lib/front_end/core/common/Revealer.ts +0 -192
- package/lib/front_end/core/common/Runnable.ts +0 -41
- package/lib/front_end/core/common/SegmentedRange.ts +0 -87
- package/lib/front_end/core/common/SettingRegistration.ts +0 -339
- package/lib/front_end/core/common/Settings.ts +0 -1497
- package/lib/front_end/core/common/SimpleHistoryManager.ts +0 -124
- package/lib/front_end/core/common/StringOutputStream.ts +0 -26
- package/lib/front_end/core/common/TextDictionary.ts +0 -48
- package/lib/front_end/core/common/Throttler.ts +0 -99
- package/lib/front_end/core/common/Trie.ts +0 -152
- package/lib/front_end/core/common/Worker.ts +0 -60
- package/lib/front_end/core/common/common.ts +0 -81
- package/lib/front_end/core/host/AidaClient.ts +0 -733
- package/lib/front_end/core/host/GdpClient.ts +0 -316
- package/lib/front_end/core/host/InspectorFrontendHost.ts +0 -648
- package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +0 -551
- package/lib/front_end/core/host/Platform.ts +0 -76
- package/lib/front_end/core/host/ResourceLoader.ts +0 -282
- package/lib/front_end/core/host/UserMetrics.ts +0 -1230
- package/lib/front_end/core/host/host.ts +0 -23
- package/lib/front_end/core/i18n/ByteUtilities.ts +0 -82
- package/lib/front_end/core/i18n/DevToolsLocale.ts +0 -87
- package/lib/front_end/core/i18n/NumberFormatter.ts +0 -82
- package/lib/front_end/core/i18n/i18n.ts +0 -17
- package/lib/front_end/core/i18n/i18nImpl.ts +0 -204
- package/lib/front_end/core/i18n/i18nTypes.ts +0 -10
- package/lib/front_end/core/i18n/locales.js +0 -14
- package/lib/front_end/core/i18n/time-utilities.ts +0 -174
- package/lib/front_end/core/platform/ArrayUtilities.ts +0 -271
- package/lib/front_end/core/platform/Brand.ts +0 -23
- package/lib/front_end/core/platform/Constructor.ts +0 -10
- package/lib/front_end/core/platform/DOMUtilities.ts +0 -138
- package/lib/front_end/core/platform/DateUtilities.ts +0 -15
- package/lib/front_end/core/platform/DevToolsPath.ts +0 -53
- package/lib/front_end/core/platform/KeyboardUtilities.ts +0 -38
- package/lib/front_end/core/platform/MapUtilities.ts +0 -95
- package/lib/front_end/core/platform/MimeType.ts +0 -175
- package/lib/front_end/core/platform/NumberUtilities.ts +0 -80
- package/lib/front_end/core/platform/StringUtilities.ts +0 -588
- package/lib/front_end/core/platform/Timing.ts +0 -17
- package/lib/front_end/core/platform/TypedArrayUtilities.ts +0 -189
- package/lib/front_end/core/platform/TypescriptUtilities.ts +0 -86
- package/lib/front_end/core/platform/UIString.ts +0 -39
- package/lib/front_end/core/platform/UserVisibleError.ts +0 -28
- package/lib/front_end/core/platform/platform.ts +0 -45
- package/lib/front_end/core/protocol_client/ConnectionTransport.ts +0 -26
- package/lib/front_end/core/protocol_client/InspectorBackend.ts +0 -1050
- package/lib/front_end/core/protocol_client/NodeURL.ts +0 -42
- package/lib/front_end/core/protocol_client/protocol_client.ts +0 -13
- package/lib/front_end/core/root/Runtime.ts +0 -609
- package/lib/front_end/core/root/root.ts +0 -6
- package/lib/front_end/core/sdk/AccessibilityModel.ts +0 -353
- package/lib/front_end/core/sdk/AnimationModel.ts +0 -1041
- package/lib/front_end/core/sdk/AutofillModel.ts +0 -184
- package/lib/front_end/core/sdk/CPUProfilerModel.ts +0 -148
- package/lib/front_end/core/sdk/CPUThrottlingManager.ts +0 -282
- package/lib/front_end/core/sdk/CSSContainerQuery.ts +0 -139
- package/lib/front_end/core/sdk/CSSFontFace.ts +0 -40
- package/lib/front_end/core/sdk/CSSLayer.ts +0 -30
- package/lib/front_end/core/sdk/CSSMatchedStyles.ts +0 -1646
- package/lib/front_end/core/sdk/CSSMedia.ts +0 -121
- package/lib/front_end/core/sdk/CSSMetadata.ts +0 -1647
- package/lib/front_end/core/sdk/CSSModel.ts +0 -1128
- package/lib/front_end/core/sdk/CSSProperty.ts +0 -384
- package/lib/front_end/core/sdk/CSSPropertyParser.ts +0 -681
- package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +0 -1395
- package/lib/front_end/core/sdk/CSSQuery.ts +0 -72
- package/lib/front_end/core/sdk/CSSRule.ts +0 -465
- package/lib/front_end/core/sdk/CSSScope.ts +0 -30
- package/lib/front_end/core/sdk/CSSStartingStyle.ts +0 -29
- package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +0 -313
- package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +0 -196
- package/lib/front_end/core/sdk/CSSSupports.ts +0 -33
- package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +0 -64
- package/lib/front_end/core/sdk/ChildTargetManager.ts +0 -314
- package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +0 -62
- package/lib/front_end/core/sdk/Connections.ts +0 -293
- package/lib/front_end/core/sdk/ConsoleModel.ts +0 -808
- package/lib/front_end/core/sdk/ConsoleModelTypes.ts +0 -15
- package/lib/front_end/core/sdk/Cookie.ts +0 -319
- package/lib/front_end/core/sdk/CookieModel.ts +0 -239
- package/lib/front_end/core/sdk/CookieParser.ts +0 -185
- package/lib/front_end/core/sdk/DOMDebuggerModel.ts +0 -787
- package/lib/front_end/core/sdk/DOMModel.ts +0 -1961
- package/lib/front_end/core/sdk/DebuggerModel.ts +0 -1605
- package/lib/front_end/core/sdk/EmulationModel.ts +0 -648
- package/lib/front_end/core/sdk/EnhancedTracesParser.ts +0 -515
- package/lib/front_end/core/sdk/EventBreakpointsModel.ts +0 -183
- package/lib/front_end/core/sdk/FrameAssociated.ts +0 -11
- package/lib/front_end/core/sdk/FrameManager.ts +0 -259
- package/lib/front_end/core/sdk/HeapProfilerModel.ts +0 -225
- package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +0 -77
- package/lib/front_end/core/sdk/IOModel.ts +0 -91
- package/lib/front_end/core/sdk/IsolateManager.ts +0 -257
- package/lib/front_end/core/sdk/IssuesModel.ts +0 -70
- package/lib/front_end/core/sdk/LayerTreeBase.ts +0 -169
- package/lib/front_end/core/sdk/LogModel.ts +0 -56
- package/lib/front_end/core/sdk/NetworkManager.ts +0 -2823
- package/lib/front_end/core/sdk/NetworkRequest.ts +0 -2253
- package/lib/front_end/core/sdk/OverlayColorGenerator.ts +0 -52
- package/lib/front_end/core/sdk/OverlayModel.ts +0 -1011
- package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -522
- package/lib/front_end/core/sdk/PageLoad.ts +0 -35
- package/lib/front_end/core/sdk/PageResourceLoader.ts +0 -435
- package/lib/front_end/core/sdk/PaintProfiler.ts +0 -110
- package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +0 -84
- package/lib/front_end/core/sdk/PreloadingModel.ts +0 -863
- package/lib/front_end/core/sdk/RehydratingConnection.ts +0 -386
- package/lib/front_end/core/sdk/RehydratingObject.ts +0 -66
- package/lib/front_end/core/sdk/RemoteObject.ts +0 -1160
- package/lib/front_end/core/sdk/Resource.ts +0 -232
- package/lib/front_end/core/sdk/ResourceTreeModel.ts +0 -1160
- package/lib/front_end/core/sdk/RuntimeModel.ts +0 -732
- package/lib/front_end/core/sdk/SDKModel.ts +0 -65
- package/lib/front_end/core/sdk/ScopeTreeCache.ts +0 -45
- package/lib/front_end/core/sdk/ScreenCaptureModel.ts +0 -255
- package/lib/front_end/core/sdk/Script.ts +0 -534
- package/lib/front_end/core/sdk/SecurityOriginManager.ts +0 -76
- package/lib/front_end/core/sdk/ServerSentEvents.ts +0 -80
- package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +0 -122
- package/lib/front_end/core/sdk/ServerTiming.ts +0 -260
- package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -377
- package/lib/front_end/core/sdk/ServiceWorkerManager.ts +0 -605
- package/lib/front_end/core/sdk/SourceMap.ts +0 -867
- package/lib/front_end/core/sdk/SourceMapCache.ts +0 -54
- package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +0 -156
- package/lib/front_end/core/sdk/SourceMapManager.ts +0 -239
- package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +0 -189
- package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +0 -508
- package/lib/front_end/core/sdk/StorageBucketsModel.ts +0 -204
- package/lib/front_end/core/sdk/StorageKeyManager.ts +0 -98
- package/lib/front_end/core/sdk/Target.ts +0 -332
- package/lib/front_end/core/sdk/TargetManager.ts +0 -453
- package/lib/front_end/core/sdk/TraceObject.ts +0 -61
- package/lib/front_end/core/sdk/WebAuthnModel.ts +0 -104
- package/lib/front_end/core/sdk/sdk.ts +0 -174
- package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -59
- package/lib/front_end/generated/InspectorBackendCommands.js +0 -1617
- package/lib/front_end/generated/SupportedCSSProperties.js +0 -7512
- package/lib/front_end/generated/protocol-proxy-api.d.ts +0 -5022
- package/lib/front_end/generated/protocol.ts +0 -22014
- package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -318
- package/lib/front_end/models/bindings/CompilerScriptMapping.ts +0 -536
- package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +0 -187
- package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +0 -1197
- package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +0 -733
- package/lib/front_end/models/bindings/DefaultScriptMapping.ts +0 -141
- package/lib/front_end/models/bindings/FileUtils.ts +0 -228
- package/lib/front_end/models/bindings/LiveLocation.ts +0 -81
- package/lib/front_end/models/bindings/NetworkProject.ts +0 -157
- package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +0 -312
- package/lib/front_end/models/bindings/ResourceMapping.ts +0 -539
- package/lib/front_end/models/bindings/ResourceScriptMapping.ts +0 -491
- package/lib/front_end/models/bindings/ResourceUtils.ts +0 -103
- package/lib/front_end/models/bindings/SASSSourceMapping.ts +0 -222
- package/lib/front_end/models/bindings/StylesSourceMapping.ts +0 -316
- package/lib/front_end/models/bindings/TempFile.ts +0 -67
- package/lib/front_end/models/bindings/bindings.ts +0 -39
- package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +0 -571
- package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +0 -103
- package/lib/front_end/models/cpu_profile/cpu_profile.ts +0 -11
- package/lib/front_end/models/formatter/FormatterWorkerPool.ts +0 -219
- package/lib/front_end/models/formatter/ScriptFormatter.ts +0 -112
- package/lib/front_end/models/formatter/formatter.ts +0 -8
- package/lib/front_end/models/source_map_scopes/NamesResolver.ts +0 -765
- package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +0 -84
- package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +0 -11
- package/lib/front_end/models/stack_trace/StackTrace.ts +0 -53
- package/lib/front_end/models/stack_trace/StackTraceImpl.ts +0 -85
- package/lib/front_end/models/stack_trace/StackTraceModel.ts +0 -128
- package/lib/front_end/models/stack_trace/Trie.ts +0 -163
- package/lib/front_end/models/stack_trace/stack_trace.ts +0 -9
- package/lib/front_end/models/stack_trace/stack_trace_impl.ts +0 -13
- package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +0 -37
- package/lib/front_end/models/text_utils/ContentData.ts +0 -199
- package/lib/front_end/models/text_utils/ContentProvider.ts +0 -68
- package/lib/front_end/models/text_utils/StaticContentProvider.ts +0 -49
- package/lib/front_end/models/text_utils/StreamingContentData.ts +0 -108
- package/lib/front_end/models/text_utils/Text.ts +0 -90
- package/lib/front_end/models/text_utils/TextCursor.ts +0 -44
- package/lib/front_end/models/text_utils/TextRange.ts +0 -266
- package/lib/front_end/models/text_utils/TextUtils.ts +0 -401
- package/lib/front_end/models/text_utils/WasmDisassembly.ts +0 -87
- package/lib/front_end/models/text_utils/text_utils.ts +0 -27
- package/lib/front_end/models/trace/EntityMapper.ts +0 -141
- package/lib/front_end/models/trace/EventsSerializer.ts +0 -101
- package/lib/front_end/models/trace/LanternComputationData.ts +0 -438
- package/lib/front_end/models/trace/ModelImpl.ts +0 -236
- package/lib/front_end/models/trace/Name.ts +0 -136
- package/lib/front_end/models/trace/Processor.ts +0 -652
- package/lib/front_end/models/trace/Styles.ts +0 -1138
- package/lib/front_end/models/trace/extras/FilmStrip.ts +0 -78
- package/lib/front_end/models/trace/extras/MainThreadActivity.ts +0 -86
- package/lib/front_end/models/trace/extras/ScriptDuplication.ts +0 -236
- package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +0 -203
- package/lib/front_end/models/trace/extras/ThirdParties.ts +0 -164
- package/lib/front_end/models/trace/extras/TraceFilter.ts +0 -62
- package/lib/front_end/models/trace/extras/TraceTree.ts +0 -701
- package/lib/front_end/models/trace/extras/extras.ts +0 -11
- package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +0 -128
- package/lib/front_end/models/trace/handlers/AnimationHandler.ts +0 -36
- package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +0 -239
- package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
- package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +0 -31
- package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +0 -306
- package/lib/front_end/models/trace/handlers/FlowsHandler.ts +0 -175
- package/lib/front_end/models/trace/handlers/FramesHandler.ts +0 -571
- package/lib/front_end/models/trace/handlers/GPUHandler.ts +0 -50
- package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +0 -183
- package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +0 -193
- package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +0 -168
- package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +0 -109
- package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +0 -35
- package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +0 -123
- package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +0 -573
- package/lib/front_end/models/trace/handlers/MemoryHandler.ts +0 -31
- package/lib/front_end/models/trace/handlers/MetaHandler.ts +0 -525
- package/lib/front_end/models/trace/handlers/ModelHandlers.ts +0 -34
- package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +0 -672
- package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +0 -52
- package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +0 -460
- package/lib/front_end/models/trace/handlers/RendererHandler.ts +0 -428
- package/lib/front_end/models/trace/handlers/SamplesHandler.ts +0 -271
- package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +0 -122
- package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +0 -336
- package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +0 -110
- package/lib/front_end/models/trace/handlers/Threads.ts +0 -139
- package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +0 -400
- package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +0 -233
- package/lib/front_end/models/trace/handlers/WarningsHandler.ts +0 -162
- package/lib/front_end/models/trace/handlers/WorkersHandler.ts +0 -45
- package/lib/front_end/models/trace/handlers/handlers.ts +0 -8
- package/lib/front_end/models/trace/handlers/helpers.ts +0 -196
- package/lib/front_end/models/trace/handlers/types.ts +0 -75
- package/lib/front_end/models/trace/helpers/Extensions.ts +0 -54
- package/lib/front_end/models/trace/helpers/Network.ts +0 -129
- package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +0 -544
- package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +0 -87
- package/lib/front_end/models/trace/helpers/Timing.ts +0 -248
- package/lib/front_end/models/trace/helpers/Trace.ts +0 -928
- package/lib/front_end/models/trace/helpers/TreeHelpers.ts +0 -320
- package/lib/front_end/models/trace/helpers/helpers.ts +0 -11
- package/lib/front_end/models/trace/insights/CLSCulprits.ts +0 -668
- package/lib/front_end/models/trace/insights/Cache.ts +0 -269
- package/lib/front_end/models/trace/insights/Common.ts +0 -453
- package/lib/front_end/models/trace/insights/DOMSize.ts +0 -223
- package/lib/front_end/models/trace/insights/DocumentLatency.ts +0 -319
- package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +0 -126
- package/lib/front_end/models/trace/insights/FontDisplay.ts +0 -119
- package/lib/front_end/models/trace/insights/ForcedReflow.ts +0 -220
- package/lib/front_end/models/trace/insights/INPBreakdown.ts +0 -171
- package/lib/front_end/models/trace/insights/ImageDelivery.ts +0 -348
- package/lib/front_end/models/trace/insights/LCPBreakdown.ts +0 -268
- package/lib/front_end/models/trace/insights/LCPDiscovery.ts +0 -237
- package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +0 -138
- package/lib/front_end/models/trace/insights/Models.ts +0 -22
- package/lib/front_end/models/trace/insights/ModernHTTP.ts +0 -257
- package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +0 -726
- package/lib/front_end/models/trace/insights/RenderBlocking.ts +0 -257
- package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +0 -175
- package/lib/front_end/models/trace/insights/Statistics.ts +0 -101
- package/lib/front_end/models/trace/insights/ThirdParties.ts +0 -130
- package/lib/front_end/models/trace/insights/Viewport.ts +0 -138
- package/lib/front_end/models/trace/insights/insights.ts +0 -10
- package/lib/front_end/models/trace/insights/types.ts +0 -157
- package/lib/front_end/models/trace/lantern/core/LanternError.ts +0 -7
- package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +0 -619
- package/lib/front_end/models/trace/lantern/core/core.ts +0 -6
- package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +0 -345
- package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +0 -80
- package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +0 -101
- package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +0 -636
- package/lib/front_end/models/trace/lantern/graph/graph.ts +0 -8
- package/lib/front_end/models/trace/lantern/lantern.ts +0 -17
- package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +0 -187
- package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +0 -88
- package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +0 -92
- package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +0 -72
- package/lib/front_end/models/trace/lantern/metrics/Metric.ts +0 -126
- package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +0 -126
- package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +0 -82
- package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +0 -112
- package/lib/front_end/models/trace/lantern/metrics/metrics.ts +0 -12
- package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +0 -150
- package/lib/front_end/models/trace/lantern/simulation/Constants.ts +0 -46
- package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +0 -61
- package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +0 -196
- package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +0 -556
- package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +0 -192
- package/lib/front_end/models/trace/lantern/simulation/simulation.ts +0 -10
- package/lib/front_end/models/trace/lantern/types/Lantern.ts +0 -220
- package/lib/front_end/models/trace/lantern/types/types.ts +0 -5
- package/lib/front_end/models/trace/trace.ts +0 -33
- package/lib/front_end/models/trace/types/Configuration.ts +0 -110
- package/lib/front_end/models/trace/types/Extensions.ts +0 -136
- package/lib/front_end/models/trace/types/File.ts +0 -281
- package/lib/front_end/models/trace/types/Overlays.ts +0 -138
- package/lib/front_end/models/trace/types/Timing.ts +0 -30
- package/lib/front_end/models/trace/types/TraceEvents.ts +0 -3277
- package/lib/front_end/models/trace/types/types.ts +0 -10
- package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +0 -240
- package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +0 -5
- package/lib/front_end/models/workspace/FileManager.ts +0 -97
- package/lib/front_end/models/workspace/IgnoreListManager.ts +0 -628
- package/lib/front_end/models/workspace/SearchConfig.ts +0 -149
- package/lib/front_end/models/workspace/UISourceCode.ts +0 -698
- package/lib/front_end/models/workspace/WorkspaceImpl.ts +0 -339
- package/lib/front_end/models/workspace/workspace.ts +0 -17
- package/lib/front_end/panels/timeline/TimelineUIUtils.ts +0 -1029
- package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +0 -49
- package/lib/front_end/panels/timeline/extensions/extensions.ts +0 -9
- package/lib/front_end/third_party/codemirror.next/LICENSE +0 -21
- package/lib/front_end/third_party/codemirror.next/README.chromium +0 -30
- package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +0 -24
- package/lib/front_end/third_party/codemirror.next/bundle.ts +0 -135
- package/lib/front_end/third_party/codemirror.next/chunk/angular.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/css.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/html.js +0 -4
- package/lib/front_end/third_party/codemirror.next/chunk/java.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/less.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/php.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/python.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/sass.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/vue.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/wast.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/chunk/xml.js +0 -2
- package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +0 -8057
- package/lib/front_end/third_party/codemirror.next/codemirror.next.js +0 -2
- package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +0 -1
- package/lib/front_end/third_party/codemirror.next/package.json +0 -43
- package/lib/front_end/third_party/codemirror.next/rebuild.sh +0 -6
- package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +0 -49
- package/lib/front_end/third_party/i18n/LICENSE +0 -202
- package/lib/front_end/third_party/i18n/README.chromium +0 -15
- package/lib/front_end/third_party/i18n/i18n-impl.ts +0 -61
- package/lib/front_end/third_party/i18n/i18n.ts +0 -11
- package/lib/front_end/third_party/i18n/localized-string-set.ts +0 -129
- package/lib/front_end/third_party/intl-messageformat/LICENSE +0 -33
- package/lib/front_end/third_party/intl-messageformat/README.chromium +0 -24
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +0 -16
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +0 -6
- package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +0 -33
- package/lib/front_end/third_party/intl-messageformat/package/README.md +0 -3
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +0 -6
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/index.js +0 -13
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +0 -5
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +0 -1710
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +0 -1815
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +0 -6
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +0 -10
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +0 -229
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +0 -28
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +0 -48
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +0 -179
- package/lib/front_end/third_party/intl-messageformat/package/package.json +0 -42
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/src/core.js +0 -230
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +0 -28
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/src/error.js +0 -51
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +0 -34
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +0 -1
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +0 -182
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +0 -79
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +0 -15
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +0 -153
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +0 -139
- package/lib/front_end/third_party/legacy-javascript/LICENSE +0 -202
- package/lib/front_end/third_party/legacy-javascript/README.chromium +0 -13
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +0 -8
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +0 -3
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +0 -18
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +0 -943
- package/lib/front_end/third_party/legacy-javascript/package.json +0 -8
- package/lib/front_end/third_party/legacy-javascript/rebuild.sh +0 -9
- package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +0 -26
- package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +0 -31
- package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +0 -33
- package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +0 -26
- package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +0 -64
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +0 -62
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +0 -37
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +0 -29
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +0 -8
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +0 -6
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +0 -21
- package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +0 -14
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +0 -196
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +0 -262
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +0 -235
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +0 -359
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +0 -39
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +0 -53
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +0 -438
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +0 -539
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +0 -23
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +0 -35
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +0 -257
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +0 -348
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +0 -8
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +0 -20
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -184
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +0 -9
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +0 -12
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +0 -82
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +0 -1
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +0 -99
- package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +0 -5
- package/lib/front_end/third_party/third-party-web/LICENSE +0 -20
- package/lib/front_end/third_party/third-party-web/README.chromium +0 -13
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +0 -149
- package/lib/front_end/third_party/third-party-web/package/LICENSE +0 -20
- package/lib/front_end/third_party/third-party-web/package/README.md +0 -929
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/dist/entities.json +0 -1
- package/lib/front_end/third_party/third-party-web/package/facades.md +0 -46
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +0 -1
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +0 -1006
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +0 -139
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +0 -44
- package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +0 -27
- package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +0 -34
- package/lib/front_end/third_party/third-party-web/package/lib/index.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +0 -246
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +0 -36
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +0 -9
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +0 -5
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +0 -151
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +0 -14
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +0 -3
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +0 -1
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +0 -1
- package/lib/front_end/third_party/third-party-web/package/package.json +0 -46
- package/lib/front_end/third_party/third-party-web/package.json +0 -8
- package/lib/front_end/third_party/third-party-web/rebuild.sh +0 -13
- package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +0 -8
- package/lib/front_end/third_party/third-party-web/third-party-web.ts +0 -3
- package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +0 -222
- package/lib/front_end/ui/legacy/theme_support/theme_support.ts +0 -5
- package/patches/chrome-devtools-frontend+1.0.1533544.patch +0 -1716
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import * as Handlers from '../handlers/handlers.js';
|
|
7
|
-
import * as Helpers from '../helpers/helpers.js';
|
|
8
|
-
import * as Types from '../types/types.js';
|
|
9
|
-
|
|
10
|
-
import {calculateDocFirstByteTs} from './Common.js';
|
|
11
|
-
import {
|
|
12
|
-
type Checklist,
|
|
13
|
-
InsightCategory,
|
|
14
|
-
InsightKeys,
|
|
15
|
-
type InsightModel,
|
|
16
|
-
type InsightSetContext,
|
|
17
|
-
InsightWarning,
|
|
18
|
-
type PartialInsightModel,
|
|
19
|
-
} from './types.js';
|
|
20
|
-
|
|
21
|
-
export const UIStrings = {
|
|
22
|
-
/**
|
|
23
|
-
* @description Title of an insight that provides details about the LCP metric, and the network requests necessary to load it. Details how the LCP request was discoverable - in other words, the path necessary to load it (ex: network requests, JavaScript)
|
|
24
|
-
*/
|
|
25
|
-
title: 'LCP request discovery',
|
|
26
|
-
/**
|
|
27
|
-
* @description Description of an insight that provides details about the LCP metric, and the network requests necessary to load it.
|
|
28
|
-
*/
|
|
29
|
-
description:
|
|
30
|
-
'[Optimize LCP](https://developer.chrome.com/docs/performance/insights/lcp-discovery) by making the LCP image discoverable from the HTML immediately, and avoiding lazy-loading',
|
|
31
|
-
/**
|
|
32
|
-
* @description Text to tell the user how long after the earliest discovery time their LCP element loaded.
|
|
33
|
-
* @example {401ms} PH1
|
|
34
|
-
*/
|
|
35
|
-
lcpLoadDelay: 'LCP image loaded {PH1} after earliest start point.',
|
|
36
|
-
/**
|
|
37
|
-
* @description Text to tell the user that a fetchpriority property value of "high" is applied to the LCP request.
|
|
38
|
-
*/
|
|
39
|
-
fetchPriorityApplied: 'fetchpriority=high applied',
|
|
40
|
-
/**
|
|
41
|
-
* @description Text to tell the user that a fetchpriority property value of "high" should be applied to the LCP request.
|
|
42
|
-
*/
|
|
43
|
-
fetchPriorityShouldBeApplied: 'fetchpriority=high should be applied',
|
|
44
|
-
/**
|
|
45
|
-
* @description Text to tell the user that the LCP request is discoverable in the initial document.
|
|
46
|
-
*/
|
|
47
|
-
requestDiscoverable: 'Request is discoverable in initial document',
|
|
48
|
-
/**
|
|
49
|
-
* @description Text to tell the user that the LCP request does not have the lazy load property applied.
|
|
50
|
-
*/
|
|
51
|
-
lazyLoadNotApplied: 'lazy load not applied',
|
|
52
|
-
/**
|
|
53
|
-
* @description Text status indicating that the the Largest Contentful Paint (LCP) metric timing was not found. "LCP" is an acronym and should not be translated.
|
|
54
|
-
*/
|
|
55
|
-
noLcp: 'No LCP detected',
|
|
56
|
-
/**
|
|
57
|
-
* @description Text status indicating that the Largest Contentful Paint (LCP) metric was text rather than an image. "LCP" is an acronym and should not be translated.
|
|
58
|
-
*/
|
|
59
|
-
noLcpResource: 'No LCP resource detected because the LCP is not an image',
|
|
60
|
-
} as const;
|
|
61
|
-
|
|
62
|
-
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LCPDiscovery.ts', UIStrings);
|
|
63
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
64
|
-
|
|
65
|
-
export function isLCPDiscoveryInsight(model: InsightModel): model is LCPDiscoveryInsightModel {
|
|
66
|
-
return model.insightKey === 'LCPDiscovery';
|
|
67
|
-
}
|
|
68
|
-
export type LCPDiscoveryInsightModel = InsightModel<typeof UIStrings, {
|
|
69
|
-
lcpEvent?: Types.Events.LargestContentfulPaintCandidate,
|
|
70
|
-
/** The network request for the LCP image, if there was one. */
|
|
71
|
-
lcpRequest?: Types.Events.SyntheticNetworkRequest,
|
|
72
|
-
earliestDiscoveryTimeTs?: Types.Timing.Micro,
|
|
73
|
-
checklist?: Checklist<'priorityHinted'|'requestDiscoverable'|'eagerlyLoaded'>,
|
|
74
|
-
}>;
|
|
75
|
-
|
|
76
|
-
function finalize(partialModel: PartialInsightModel<LCPDiscoveryInsightModel>): LCPDiscoveryInsightModel {
|
|
77
|
-
const relatedEvents = partialModel.lcpEvent && partialModel.lcpRequest ?
|
|
78
|
-
// TODO: add entire request initiator chain?
|
|
79
|
-
[partialModel.lcpEvent, partialModel.lcpRequest] :
|
|
80
|
-
[];
|
|
81
|
-
return {
|
|
82
|
-
insightKey: InsightKeys.LCP_DISCOVERY,
|
|
83
|
-
strings: UIStrings,
|
|
84
|
-
title: i18nString(UIStrings.title),
|
|
85
|
-
description: i18nString(UIStrings.description),
|
|
86
|
-
docs: 'https://developer.chrome.com/docs/performance/insights/lcp-discovery',
|
|
87
|
-
category: InsightCategory.LCP,
|
|
88
|
-
state: partialModel.lcpRequest && partialModel.checklist &&
|
|
89
|
-
(!partialModel.checklist.eagerlyLoaded.value || !partialModel.checklist.requestDiscoverable.value ||
|
|
90
|
-
!partialModel.checklist.priorityHinted.value) ?
|
|
91
|
-
'fail' :
|
|
92
|
-
'pass',
|
|
93
|
-
...partialModel,
|
|
94
|
-
relatedEvents,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function generateInsight(
|
|
99
|
-
data: Handlers.Types.HandlerData, context: InsightSetContext): LCPDiscoveryInsightModel {
|
|
100
|
-
if (!context.navigation) {
|
|
101
|
-
return finalize({});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const networkRequests = data.NetworkRequests;
|
|
105
|
-
|
|
106
|
-
const frameMetrics = data.PageLoadMetrics.metricScoresByFrameId.get(context.frameId);
|
|
107
|
-
if (!frameMetrics) {
|
|
108
|
-
throw new Error('no frame metrics');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const navMetrics = frameMetrics.get(context.navigationId);
|
|
112
|
-
if (!navMetrics) {
|
|
113
|
-
throw new Error('no navigation metrics');
|
|
114
|
-
}
|
|
115
|
-
const metricScore = navMetrics.get(Handlers.ModelHandlers.PageLoadMetrics.MetricName.LCP);
|
|
116
|
-
const lcpEvent = metricScore?.event;
|
|
117
|
-
if (!lcpEvent || !Types.Events.isLargestContentfulPaintCandidate(lcpEvent)) {
|
|
118
|
-
return finalize({warnings: [InsightWarning.NO_LCP]});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const docRequest = networkRequests.byId.get(context.navigationId);
|
|
122
|
-
if (!docRequest) {
|
|
123
|
-
return finalize({warnings: [InsightWarning.NO_DOCUMENT_REQUEST]});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const lcpRequest = data.LargestImagePaint.lcpRequestByNavigationId.get(context.navigationId);
|
|
127
|
-
if (!lcpRequest) {
|
|
128
|
-
return finalize({lcpEvent});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const initiatorUrl = lcpRequest.args.data.initiator?.url;
|
|
132
|
-
// TODO(b/372319476): Explore using trace event HTMLDocumentParser::FetchQueuedPreloads to determine if the request
|
|
133
|
-
// is discovered by the preload scanner.
|
|
134
|
-
const initiatedByMainDoc =
|
|
135
|
-
lcpRequest?.args.data.initiator?.type === 'parser' && docRequest.args.data.url === initiatorUrl;
|
|
136
|
-
const imgPreloadedOrFoundInHTML = lcpRequest?.args.data.isLinkPreload || initiatedByMainDoc;
|
|
137
|
-
|
|
138
|
-
const imageLoadingAttr = lcpEvent.args.data?.loadingAttr;
|
|
139
|
-
const imageFetchPriorityHint = lcpRequest?.args.data.fetchPriorityHint;
|
|
140
|
-
// This is the earliest discovery time an LCP request could have - it's TTFB (as an absolute timestamp).
|
|
141
|
-
const earliestDiscoveryTime = calculateDocFirstByteTs(docRequest);
|
|
142
|
-
|
|
143
|
-
const priorityHintFound = imageFetchPriorityHint === 'high';
|
|
144
|
-
|
|
145
|
-
return finalize({
|
|
146
|
-
lcpEvent,
|
|
147
|
-
lcpRequest,
|
|
148
|
-
earliestDiscoveryTimeTs: earliestDiscoveryTime ? Types.Timing.Micro(earliestDiscoveryTime) : undefined,
|
|
149
|
-
checklist: {
|
|
150
|
-
priorityHinted: {
|
|
151
|
-
label: priorityHintFound ? i18nString(UIStrings.fetchPriorityApplied) :
|
|
152
|
-
i18nString(UIStrings.fetchPriorityShouldBeApplied),
|
|
153
|
-
value: priorityHintFound
|
|
154
|
-
},
|
|
155
|
-
requestDiscoverable: {label: i18nString(UIStrings.requestDiscoverable), value: imgPreloadedOrFoundInHTML},
|
|
156
|
-
eagerlyLoaded: {label: i18nString(UIStrings.lazyLoadNotApplied), value: imageLoadingAttr !== 'lazy'},
|
|
157
|
-
},
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
interface LCPImageDiscoveryData {
|
|
162
|
-
checklist: Exclude<LCPDiscoveryInsightModel['checklist'], undefined>;
|
|
163
|
-
request: Types.Events.SyntheticNetworkRequest;
|
|
164
|
-
discoveryDelay: Types.Timing.Micro|null;
|
|
165
|
-
estimatedSavings: Types.Timing.Milli|null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* TODO: this extra transformation (getImageData) should not be necessary.
|
|
170
|
-
*/
|
|
171
|
-
export function getImageData(model: LCPDiscoveryInsightModel): LCPImageDiscoveryData|null {
|
|
172
|
-
if (!model.lcpRequest || !model.checklist) {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const shouldIncreasePriorityHint = !model.checklist.priorityHinted.value;
|
|
177
|
-
const shouldPreloadImage = !model.checklist.requestDiscoverable.value;
|
|
178
|
-
const shouldRemoveLazyLoading = !model.checklist.eagerlyLoaded.value;
|
|
179
|
-
|
|
180
|
-
const imageLCP = shouldIncreasePriorityHint !== undefined && shouldPreloadImage !== undefined &&
|
|
181
|
-
shouldRemoveLazyLoading !== undefined;
|
|
182
|
-
|
|
183
|
-
// Shouldn't render anything if lcp insight is null or lcp is text.
|
|
184
|
-
if (!imageLCP) {
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const data: LCPImageDiscoveryData = {
|
|
189
|
-
checklist: model.checklist,
|
|
190
|
-
request: model.lcpRequest,
|
|
191
|
-
discoveryDelay: null,
|
|
192
|
-
estimatedSavings: model.metricSavings?.LCP ?? null,
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
if (model.earliestDiscoveryTimeTs && model.lcpRequest) {
|
|
196
|
-
const discoveryDelay = model.lcpRequest.ts - model.earliestDiscoveryTimeTs;
|
|
197
|
-
data.discoveryDelay = Types.Timing.Micro(discoveryDelay);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return data;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function createOverlays(model: LCPDiscoveryInsightModel): Types.Overlays.Overlay[] {
|
|
204
|
-
const imageResults = getImageData(model);
|
|
205
|
-
if (!imageResults?.discoveryDelay) {
|
|
206
|
-
return [];
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const delay = Helpers.Timing.traceWindowFromMicroSeconds(
|
|
210
|
-
Types.Timing.Micro(imageResults.request.ts - imageResults.discoveryDelay),
|
|
211
|
-
imageResults.request.ts,
|
|
212
|
-
);
|
|
213
|
-
|
|
214
|
-
return [
|
|
215
|
-
{
|
|
216
|
-
type: 'ENTRY_OUTLINE',
|
|
217
|
-
entry: imageResults.request,
|
|
218
|
-
outlineReason: 'ERROR',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
type: 'CANDY_STRIPED_TIME_RANGE',
|
|
222
|
-
bounds: delay,
|
|
223
|
-
entry: imageResults.request,
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
type: 'TIMESPAN_BREAKDOWN',
|
|
227
|
-
sections: [{
|
|
228
|
-
bounds: delay,
|
|
229
|
-
// This is overridden in the component.
|
|
230
|
-
label: `${imageResults.discoveryDelay} microseconds`,
|
|
231
|
-
showDuration: false,
|
|
232
|
-
}],
|
|
233
|
-
entry: imageResults.request,
|
|
234
|
-
renderLocation: 'ABOVE_EVENT',
|
|
235
|
-
},
|
|
236
|
-
];
|
|
237
|
-
}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import * as LegacyJavaScriptLib from '../../../third_party/legacy-javascript/legacy-javascript.js';
|
|
7
|
-
import type * as Handlers from '../handlers/handlers.js';
|
|
8
|
-
import * as Helpers from '../helpers/helpers.js';
|
|
9
|
-
import type * as Types from '../types/types.js';
|
|
10
|
-
|
|
11
|
-
import {estimateCompressionRatioForScript, metricSavingsForWastedBytes} from './Common.js';
|
|
12
|
-
import {
|
|
13
|
-
InsightCategory,
|
|
14
|
-
InsightKeys,
|
|
15
|
-
type InsightModel,
|
|
16
|
-
type InsightSetContext,
|
|
17
|
-
type PartialInsightModel,
|
|
18
|
-
} from './types.js';
|
|
19
|
-
|
|
20
|
-
const {detectLegacyJavaScript} = LegacyJavaScriptLib.LegacyJavaScript;
|
|
21
|
-
|
|
22
|
-
export const UIStrings = {
|
|
23
|
-
/**
|
|
24
|
-
* @description Title of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.
|
|
25
|
-
*/
|
|
26
|
-
title: 'Legacy JavaScript',
|
|
27
|
-
/**
|
|
28
|
-
* @description Description of an insight that identifies polyfills for modern JavaScript features, and recommends their removal.
|
|
29
|
-
*/
|
|
30
|
-
description:
|
|
31
|
-
'Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren\'t necessary for modern browsers. Consider modifying your JavaScript build process to not transpile [Baseline](https://web.dev/articles/baseline-and-polyfills) features, unless you know you must support older browsers. [Learn why most sites can deploy ES6+ code without transpiling](https://developer.chrome.com/docs/performance/insights/legacy-javascript)',
|
|
32
|
-
/** Label for a column in a data table; entries will be the individual JavaScript scripts. */
|
|
33
|
-
columnScript: 'Script',
|
|
34
|
-
/** Label for a column in a data table; entries will be the number of wasted bytes (aka the estimated savings in terms of bytes). */
|
|
35
|
-
columnWastedBytes: 'Wasted bytes',
|
|
36
|
-
} as const;
|
|
37
|
-
|
|
38
|
-
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/LegacyJavaScript.ts', UIStrings);
|
|
39
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
40
|
-
|
|
41
|
-
export interface PatternMatchResult {
|
|
42
|
-
name: string;
|
|
43
|
-
line: number;
|
|
44
|
-
column: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
interface LegacyJavaScriptResult {
|
|
48
|
-
matches: PatternMatchResult[];
|
|
49
|
-
estimatedByteSavings: number;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
type LegacyJavaScriptResults = Map<Handlers.ModelHandlers.Scripts.Script, LegacyJavaScriptResult>;
|
|
53
|
-
|
|
54
|
-
export type LegacyJavaScriptInsightModel = InsightModel<typeof UIStrings, {
|
|
55
|
-
legacyJavaScriptResults: LegacyJavaScriptResults,
|
|
56
|
-
}>;
|
|
57
|
-
|
|
58
|
-
const BYTE_THRESHOLD = 5000;
|
|
59
|
-
|
|
60
|
-
function finalize(partialModel: PartialInsightModel<LegacyJavaScriptInsightModel>): LegacyJavaScriptInsightModel {
|
|
61
|
-
const requests = [...partialModel.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e);
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
insightKey: InsightKeys.LEGACY_JAVASCRIPT,
|
|
65
|
-
strings: UIStrings,
|
|
66
|
-
title: i18nString(UIStrings.title),
|
|
67
|
-
description: i18nString(UIStrings.description),
|
|
68
|
-
docs: 'https://developer.chrome.com/docs/performance/insights/legacy-javascript',
|
|
69
|
-
category: InsightCategory.ALL,
|
|
70
|
-
state: requests.length ? 'fail' : 'pass',
|
|
71
|
-
relatedEvents: [...new Set(requests)],
|
|
72
|
-
...partialModel,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function isLegacyJavaScript(model: InsightModel): model is LegacyJavaScriptInsightModel {
|
|
77
|
-
return model.insightKey === InsightKeys.LEGACY_JAVASCRIPT;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function generateInsight(
|
|
81
|
-
data: Handlers.Types.HandlerData, context: InsightSetContext): LegacyJavaScriptInsightModel {
|
|
82
|
-
const scripts = data.Scripts.scripts.filter(script => {
|
|
83
|
-
if (script.frame !== context.frameId) {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (script.url?.startsWith('chrome-extension://')) {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return Helpers.Timing.timestampIsInBounds(context.bounds, script.ts) ||
|
|
92
|
-
(script.request && Helpers.Timing.eventIsInBounds(script.request, context.bounds));
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
const legacyJavaScriptResults: LegacyJavaScriptResults = new Map();
|
|
96
|
-
const wastedBytesByRequestId = new Map<string, number>();
|
|
97
|
-
|
|
98
|
-
for (const script of scripts) {
|
|
99
|
-
if (!script.content || script.content.length < BYTE_THRESHOLD) {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const result = detectLegacyJavaScript(script.content, script.sourceMap);
|
|
104
|
-
if (result.estimatedByteSavings < BYTE_THRESHOLD) {
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Translate from resource size to transfer size.
|
|
109
|
-
const compressionRatio = estimateCompressionRatioForScript(script);
|
|
110
|
-
const transferSize = Math.round(result.estimatedByteSavings * compressionRatio);
|
|
111
|
-
result.estimatedByteSavings = transferSize;
|
|
112
|
-
|
|
113
|
-
legacyJavaScriptResults.set(script, result);
|
|
114
|
-
|
|
115
|
-
if (script.request) {
|
|
116
|
-
const requestId = script.request.args.data.requestId;
|
|
117
|
-
wastedBytesByRequestId.set(requestId, transferSize);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const sorted =
|
|
122
|
-
new Map([...legacyJavaScriptResults].sort((a, b) => b[1].estimatedByteSavings - a[1].estimatedByteSavings));
|
|
123
|
-
|
|
124
|
-
return finalize({
|
|
125
|
-
legacyJavaScriptResults: sorted,
|
|
126
|
-
metricSavings: metricSavingsForWastedBytes(wastedBytesByRequestId, context),
|
|
127
|
-
wastedBytes: wastedBytesByRequestId.values().reduce((acc, cur) => acc + cur, 0),
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
export function createOverlays(model: LegacyJavaScriptInsightModel): Types.Overlays.Overlay[] {
|
|
131
|
-
return [...model.legacyJavaScriptResults.keys()].map(script => script.request).filter(e => !!e).map(request => {
|
|
132
|
-
return {
|
|
133
|
-
type: 'ENTRY_OUTLINE',
|
|
134
|
-
entry: request,
|
|
135
|
-
outlineReason: 'ERROR',
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// Copyright 2024 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
export * as Cache from './Cache.js';
|
|
6
|
-
export * as CLSCulprits from './CLSCulprits.js';
|
|
7
|
-
export * as DocumentLatency from './DocumentLatency.js';
|
|
8
|
-
export * as DOMSize from './DOMSize.js';
|
|
9
|
-
export * as DuplicatedJavaScript from './DuplicatedJavaScript.js';
|
|
10
|
-
export * as FontDisplay from './FontDisplay.js';
|
|
11
|
-
export * as ForcedReflow from './ForcedReflow.js';
|
|
12
|
-
export * as ImageDelivery from './ImageDelivery.js';
|
|
13
|
-
export * as INPBreakdown from './INPBreakdown.js';
|
|
14
|
-
export * as LCPBreakdown from './LCPBreakdown.js';
|
|
15
|
-
export * as LCPDiscovery from './LCPDiscovery.js';
|
|
16
|
-
export * as LegacyJavaScript from './LegacyJavaScript.js';
|
|
17
|
-
export * as ModernHTTP from './ModernHTTP.js';
|
|
18
|
-
export * as NetworkDependencyTree from './NetworkDependencyTree.js';
|
|
19
|
-
export * as RenderBlocking from './RenderBlocking.js';
|
|
20
|
-
export * as SlowCSSSelector from './SlowCSSSelector.js';
|
|
21
|
-
export * as ThirdParties from './ThirdParties.js';
|
|
22
|
-
export * as Viewport from './Viewport.js';
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as i18n from '../../../core/i18n/i18n.js';
|
|
6
|
-
import * as Platform from '../../../core/platform/platform.js';
|
|
7
|
-
import * as Handlers from '../handlers/handlers.js';
|
|
8
|
-
import * as Helpers from '../helpers/helpers.js';
|
|
9
|
-
import type * as Lantern from '../lantern/lantern.js';
|
|
10
|
-
import type * as Types from '../types/types.js';
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
InsightCategory,
|
|
14
|
-
InsightKeys,
|
|
15
|
-
type InsightModel,
|
|
16
|
-
type InsightSetContext,
|
|
17
|
-
type MetricSavings,
|
|
18
|
-
type PartialInsightModel,
|
|
19
|
-
} from './types.js';
|
|
20
|
-
|
|
21
|
-
export const UIStrings = {
|
|
22
|
-
/**
|
|
23
|
-
* @description Title of an insight that recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
|
|
24
|
-
*/
|
|
25
|
-
title: 'Modern HTTP',
|
|
26
|
-
/**
|
|
27
|
-
* @description Description of an insight that recommends recommends using HTTP/2 over HTTP/1.1 because of the performance benefits. "HTTP" should not be translated.
|
|
28
|
-
*/
|
|
29
|
-
description:
|
|
30
|
-
'HTTP/2 and HTTP/3 offer many benefits over HTTP/1.1, such as multiplexing. [Learn more about using modern HTTP](https://developer.chrome.com/docs/performance/insights/modern-http).',
|
|
31
|
-
/**
|
|
32
|
-
* @description Column header for a table where each cell represents a network request.
|
|
33
|
-
*/
|
|
34
|
-
request: 'Request',
|
|
35
|
-
/**
|
|
36
|
-
* @description Column header for a table where each cell represents the protocol of a network request.
|
|
37
|
-
*/
|
|
38
|
-
protocol: 'Protocol',
|
|
39
|
-
/**
|
|
40
|
-
* @description Text explaining that there were not requests that were slowed down by using HTTP/1.1. "HTTP/1.1" should not be translated.
|
|
41
|
-
*/
|
|
42
|
-
noOldProtocolRequests:
|
|
43
|
-
'No requests used HTTP/1.1, or its current use of HTTP/1.1 does not present a significant optimization opportunity. HTTP/1.1 requests are only flagged if six or more static assets originate from the same origin, and they are not served from a local development environment or a third-party source.'
|
|
44
|
-
} as const;
|
|
45
|
-
|
|
46
|
-
const str_ = i18n.i18n.registerUIStrings('models/trace/insights/ModernHTTP.ts', UIStrings);
|
|
47
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
48
|
-
|
|
49
|
-
export type ModernHTTPInsightModel = InsightModel<typeof UIStrings, {
|
|
50
|
-
http1Requests: Types.Events.SyntheticNetworkRequest[],
|
|
51
|
-
}>;
|
|
52
|
-
|
|
53
|
-
export function isModernHTTPInsight(model: InsightModel): model is ModernHTTPInsightModel {
|
|
54
|
-
return model.insightKey === InsightKeys.MODERN_HTTP;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Determines whether a network request is a "static resource" that would benefit from H2 multiplexing.
|
|
59
|
-
* XHRs, tracking pixels, etc generally don't benefit as much because they aren't requested en-masse
|
|
60
|
-
* for the same origin at the exact same time.
|
|
61
|
-
*/
|
|
62
|
-
function isMultiplexableStaticAsset(
|
|
63
|
-
request: Types.Events.SyntheticNetworkRequest, entityMappings: Handlers.Helpers.EntityMappings,
|
|
64
|
-
firstPartyEntity: Handlers.Helpers.Entity|null): boolean {
|
|
65
|
-
if (!Helpers.Network.STATIC_RESOURCE_TYPES.has(request.args.data.resourceType)) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Resources from third-parties that are less than 100 bytes are usually tracking pixels, not actual resources.
|
|
70
|
-
// They can masquerade as static types though (gifs, documents, etc)
|
|
71
|
-
if (request.args.data.decodedBodyLength < 100) {
|
|
72
|
-
const entity = entityMappings.entityByEvent.get(request);
|
|
73
|
-
if (entity) {
|
|
74
|
-
// Third-party assets are multiplexable in their first-party context.
|
|
75
|
-
if (firstPartyEntity?.name === entity.name) {
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
// Skip recognizable third-parties' requests.
|
|
79
|
-
if (!entity.isUnrecognized) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Determine the set of resources that aren't HTTP/2 but should be.
|
|
90
|
-
* We're a little conservative about what we surface for a few reasons:
|
|
91
|
-
*
|
|
92
|
-
* - The simulator approximation of HTTP/2 is a little more generous than reality.
|
|
93
|
-
* - There's a bit of debate surrounding HTTP/2 due to its worse performance in environments with high packet loss. [1][2][3]
|
|
94
|
-
* - It's something that you'd have absolutely zero control over with a third-party (can't defer to fix it for example).
|
|
95
|
-
*
|
|
96
|
-
* Therefore, we only surface requests that were...
|
|
97
|
-
*
|
|
98
|
-
* - Served over HTTP/1.1 or earlier
|
|
99
|
-
* - Served over an origin that serves at least 6 static asset requests
|
|
100
|
-
* (if there aren't more requests than browser's max/host, multiplexing isn't as big a deal)
|
|
101
|
-
* - Not served on localhost (h2 is a pain to deal with locally & and CI)
|
|
102
|
-
*
|
|
103
|
-
* [1] https://news.ycombinator.com/item?id=19086639
|
|
104
|
-
* [2] https://www.twilio.com/blog/2017/10/http2-issues.html
|
|
105
|
-
* [3] https://www.cachefly.com/http-2-is-not-a-magic-bullet/
|
|
106
|
-
*/
|
|
107
|
-
export function determineHttp1Requests(
|
|
108
|
-
requests: Types.Events.SyntheticNetworkRequest[], entityMappings: Handlers.Helpers.EntityMappings,
|
|
109
|
-
firstPartyEntity: Handlers.Helpers.Entity|null): Types.Events.SyntheticNetworkRequest[] {
|
|
110
|
-
const http1Requests: Types.Events.SyntheticNetworkRequest[] = [];
|
|
111
|
-
|
|
112
|
-
const groupedByOrigin = new Map<string, Types.Events.SyntheticNetworkRequest[]>();
|
|
113
|
-
for (const record of requests) {
|
|
114
|
-
const url = new URL(record.args.data.url);
|
|
115
|
-
if (!isMultiplexableStaticAsset(record, entityMappings, firstPartyEntity)) {
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
if (Helpers.Network.isSyntheticNetworkRequestLocalhost(record)) {
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
const originRequests = Platform.MapUtilities.getWithDefault(groupedByOrigin, url.origin, () => []);
|
|
122
|
-
originRequests.push(record);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const seenURLs = new Set<string>();
|
|
126
|
-
|
|
127
|
-
for (const request of requests) {
|
|
128
|
-
// Skip duplicates.
|
|
129
|
-
if (seenURLs.has(request.args.data.url)) {
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Check if record is not served through the service worker, servicer worker uses http/1.1 as a protocol.
|
|
134
|
-
// These can generate false positives (bug: https://github.com/GoogleChrome/lighthouse/issues/7158).
|
|
135
|
-
if (request.args.data.fromServiceWorker) {
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Test the protocol to see if it was http/1.1.
|
|
140
|
-
const isOldHttp = /HTTP\/[01][.\d]?/i.test(request.args.data.protocol);
|
|
141
|
-
if (!isOldHttp) {
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
const url = new URL(request.args.data.url);
|
|
146
|
-
|
|
147
|
-
// Check if the origin has enough requests to bother flagging.
|
|
148
|
-
const group = groupedByOrigin.get(url.origin) || [];
|
|
149
|
-
if (group.length < 6) {
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
seenURLs.add(request.args.data.url);
|
|
154
|
-
http1Requests.push(request);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return http1Requests;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Computes the estimated effect of all results being converted to http/2 on the provided graph.
|
|
162
|
-
*/
|
|
163
|
-
function computeWasteWithGraph(
|
|
164
|
-
urlsToChange: Set<string>, graph: Lantern.Graph.Node, simulator: Lantern.Simulation.Simulator): Types.Timing.Milli {
|
|
165
|
-
const simulationBefore = simulator.simulate(graph);
|
|
166
|
-
|
|
167
|
-
// Update all the protocols to reflect implementing our recommendations
|
|
168
|
-
const originalProtocols = new Map();
|
|
169
|
-
graph.traverse(node => {
|
|
170
|
-
if (node.type !== 'network') {
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
if (!urlsToChange.has(node.request.url)) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
originalProtocols.set(node.request.requestId, node.request.protocol);
|
|
178
|
-
node.request.protocol = 'h2';
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const simulationAfter = simulator.simulate(graph);
|
|
182
|
-
|
|
183
|
-
// Restore the original protocol after we've done our simulation
|
|
184
|
-
graph.traverse(node => {
|
|
185
|
-
if (node.type !== 'network') {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
const originalProtocol = originalProtocols.get(node.request.requestId);
|
|
189
|
-
if (originalProtocol === undefined) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
node.request.protocol = originalProtocol;
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
const savings = simulationBefore.timeInMs - simulationAfter.timeInMs;
|
|
196
|
-
|
|
197
|
-
return Platform.NumberUtilities.floor(savings, 1 / 10) as Types.Timing.Milli;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function computeMetricSavings(
|
|
201
|
-
http1Requests: Types.Events.SyntheticNetworkRequest[], context: InsightSetContext): MetricSavings|undefined {
|
|
202
|
-
if (!context.navigation || !context.lantern) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const urlsToChange = new Set(http1Requests.map(r => r.args.data.url));
|
|
207
|
-
|
|
208
|
-
const fcpGraph = context.lantern.metrics.firstContentfulPaint.optimisticGraph;
|
|
209
|
-
const lcpGraph = context.lantern.metrics.largestContentfulPaint.optimisticGraph;
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
FCP: computeWasteWithGraph(urlsToChange, fcpGraph, context.lantern.simulator),
|
|
213
|
-
LCP: computeWasteWithGraph(urlsToChange, lcpGraph, context.lantern.simulator),
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function finalize(partialModel: PartialInsightModel<ModernHTTPInsightModel>): ModernHTTPInsightModel {
|
|
218
|
-
return {
|
|
219
|
-
insightKey: InsightKeys.MODERN_HTTP,
|
|
220
|
-
strings: UIStrings,
|
|
221
|
-
title: i18nString(UIStrings.title),
|
|
222
|
-
description: i18nString(UIStrings.description),
|
|
223
|
-
docs: 'https://developer.chrome.com/docs/performance/insights/modern-http',
|
|
224
|
-
category: InsightCategory.LCP,
|
|
225
|
-
state: partialModel.http1Requests.length > 0 ? 'fail' : 'pass',
|
|
226
|
-
...partialModel,
|
|
227
|
-
relatedEvents: partialModel.http1Requests,
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export function generateInsight(data: Handlers.Types.HandlerData, context: InsightSetContext): ModernHTTPInsightModel {
|
|
232
|
-
const isWithinContext = (event: Types.Events.Event): boolean => Helpers.Timing.eventIsInBounds(event, context.bounds);
|
|
233
|
-
|
|
234
|
-
const contextRequests = data.NetworkRequests.byTime.filter(isWithinContext);
|
|
235
|
-
|
|
236
|
-
const entityMappings = data.NetworkRequests.entityMappings;
|
|
237
|
-
const firstPartyUrl = context.navigation?.args.data?.documentLoaderURL ?? data.Meta.mainFrameURL;
|
|
238
|
-
const firstPartyEntity = Handlers.Helpers.getEntityForUrl(firstPartyUrl, entityMappings);
|
|
239
|
-
const http1Requests = determineHttp1Requests(contextRequests, entityMappings, firstPartyEntity ?? null);
|
|
240
|
-
|
|
241
|
-
return finalize({
|
|
242
|
-
http1Requests,
|
|
243
|
-
metricSavings: computeMetricSavings(http1Requests, context),
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export function createOverlayForRequest(request: Types.Events.SyntheticNetworkRequest): Types.Overlays.EntryOutline {
|
|
248
|
-
return {
|
|
249
|
-
type: 'ENTRY_OUTLINE',
|
|
250
|
-
entry: request,
|
|
251
|
-
outlineReason: 'ERROR',
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export function createOverlays(model: ModernHTTPInsightModel): Types.Overlays.Overlay[] {
|
|
256
|
-
return model.http1Requests.map(req => createOverlayForRequest(req)) ?? [];
|
|
257
|
-
}
|