@paulirish/trace_engine 0.0.67-beta.2 → 0.0.68
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/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +13 -0
- package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts +17 -0
- package/.tmp/tsbuildinfo/analyze-trace.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts +2 -0
- package/.tmp/tsbuildinfo/test/test-trace-engine.d.mts.map +1 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts +3 -0
- package/.tmp/tsbuildinfo/third_party/third-party-web/third-party-web.d.ts.map +1 -0
- package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -0
- package/README.md +22 -62
- package/analyze-inspector-issues.mjs +60 -0
- package/analyze-trace.mjs +144 -6
- package/core/common/ParsedURL.d.ts +0 -2
- package/core/common/ParsedURL.js +512 -0
- package/core/common/ParsedURL.js.map +1 -0
- package/core/common/common.d.ts +8 -33
- package/core/common/common.js +2 -0
- package/core/host/host.d.ts +1 -13
- package/core/host/host.js +1 -0
- package/core/i18n/i18n.d.ts +20 -8
- package/core/i18n/i18n.js +15 -0
- package/core/platform/ArrayUtilities.js +224 -0
- package/core/platform/ArrayUtilities.js.map +1 -0
- package/core/platform/Brand.js +5 -0
- package/core/platform/Brand.js.map +1 -0
- package/core/platform/Constructor.js +5 -0
- package/core/platform/Constructor.js.map +1 -0
- package/core/platform/DateUtilities.js +14 -0
- package/core/platform/DateUtilities.js.map +1 -0
- package/core/platform/DevToolsPath.js +28 -0
- package/core/platform/DevToolsPath.js.map +1 -0
- package/core/platform/HostRuntime.js +8 -0
- package/core/platform/HostRuntime.js.map +1 -0
- package/core/platform/KeyboardUtilities.js +34 -0
- package/core/platform/KeyboardUtilities.js.map +1 -0
- package/core/platform/MapUtilities.js +80 -0
- package/core/platform/MapUtilities.js.map +1 -0
- package/core/platform/MimeType.js +157 -0
- package/core/platform/MimeType.js.map +1 -0
- package/core/platform/NumberUtilities.js +73 -0
- package/core/platform/NumberUtilities.js.map +1 -0
- package/core/platform/Size.js +36 -0
- package/core/platform/Size.js.map +1 -0
- package/core/platform/StringUtilities.d.ts +15 -4
- package/core/platform/StringUtilities.js +767 -0
- package/core/platform/StringUtilities.js.map +1 -0
- package/core/platform/Timing.js +10 -0
- package/core/platform/Timing.js.map +1 -0
- package/core/platform/TypedArrayUtilities.js +158 -0
- package/core/platform/TypedArrayUtilities.js.map +1 -0
- package/core/platform/TypescriptUtilities.js +17 -0
- package/core/platform/TypescriptUtilities.js.map +1 -0
- package/core/platform/UIString.d.ts +5 -2
- package/core/platform/UIString.js +5 -0
- package/core/platform/UIString.js.map +1 -0
- package/core/platform/UserVisibleError.d.ts +1 -12
- package/core/platform/UserVisibleError.js +23 -0
- package/core/platform/UserVisibleError.js.map +1 -0
- package/core/platform/api/HostRuntime.d.ts +1 -0
- package/core/platform/api/HostRuntime.js +5 -0
- package/core/platform/api/HostRuntime.js.map +1 -0
- package/core/platform/api/api-tsconfig.json +58 -0
- package/core/platform/api/api-tsconfig.ref.json +26 -0
- package/core/platform/api/api.js +6 -0
- package/core/platform/api/api.js.map +1 -0
- package/core/platform/bundle-tsconfig.json +59 -0
- package/core/platform/bundle-tsconfig.ref.json +27 -0
- package/core/platform/foundation_unittests-tsconfig.json +73 -0
- package/core/platform/foundation_unittests-tsconfig.ref.json +40 -0
- package/core/platform/foundation_unittests_node_typecheck-tsconfig.json +69 -0
- package/core/platform/platform-tsconfig.json +81 -0
- package/core/platform/platform-tsconfig.ref.json +49 -0
- package/core/platform/platform.js +28 -0
- package/core/platform/platform.js.map +1 -0
- package/core/platform/platform_node_typecheck-tsconfig.json +78 -0
- package/core/platform/platform_node_typecheck.stamp +0 -0
- package/core/root/root.d.ts +1 -4
- package/core/root/root.js +1 -0
- package/core/sdk/sdk.d.ts +27 -97
- package/core/sdk/sdk.js +1 -0
- package/generated/protocol.d.ts +34 -6
- package/generated/protocol.js +3312 -0
- package/locales/af.json +94 -97
- package/locales/am.json +353 -356
- package/locales/ar.json +354 -357
- package/locales/as.json +352 -355
- package/locales/az.json +343 -346
- package/locales/be.json +353 -356
- package/locales/bg.json +353 -356
- package/locales/bn.json +353 -356
- package/locales/bs.json +247 -250
- package/locales/ca.json +285 -288
- package/locales/cs.json +338 -341
- package/locales/cy.json +124 -127
- package/locales/da.json +202 -205
- package/locales/de.json +222 -225
- package/locales/el.json +338 -341
- package/locales/en-GB.json +78 -81
- package/locales/en-US.json +250 -256
- package/locales/en-XL.json +1052 -0
- package/locales/es-419.json +278 -281
- package/locales/es.json +279 -282
- package/locales/et.json +237 -240
- package/locales/eu.json +124 -127
- package/locales/fa.json +353 -356
- package/locales/fi.json +283 -286
- package/locales/fil.json +32 -35
- package/locales/fr-CA.json +310 -313
- package/locales/fr.json +307 -310
- package/locales/gl.json +263 -266
- package/locales/gu.json +354 -357
- package/locales/he.json +354 -357
- package/locales/hi.json +338 -341
- package/locales/hr.json +238 -241
- package/locales/hu.json +344 -347
- package/locales/hy.json +353 -356
- package/locales/id.json +67 -70
- package/locales/is.json +305 -308
- package/locales/it.json +175 -178
- package/locales/ja.json +353 -356
- package/locales/ka.json +354 -357
- package/locales/kk.json +354 -357
- package/locales/km.json +353 -356
- package/locales/kn.json +354 -357
- package/locales/ko.json +353 -356
- package/locales/ky.json +352 -355
- package/locales/lo.json +354 -357
- package/locales/lt.json +322 -325
- package/locales/lv.json +319 -322
- package/locales/mk.json +354 -357
- package/locales/ml.json +353 -356
- package/locales/mn.json +353 -356
- package/locales/mr.json +353 -356
- package/locales/ms.json +14 -17
- package/locales/my.json +352 -355
- package/locales/ne.json +338 -341
- package/locales/nl.json +91 -94
- package/locales/no.json +179 -182
- package/locales/or.json +353 -356
- package/locales/pa.json +353 -356
- package/locales/pl.json +309 -312
- package/locales/pt-PT.json +275 -278
- package/locales/pt.json +268 -271
- package/locales/ro.json +309 -312
- package/locales/ru.json +353 -356
- package/locales/si.json +354 -357
- package/locales/sk.json +335 -338
- package/locales/sl.json +220 -223
- package/locales/sq.json +318 -321
- package/locales/sr-Latn.json +255 -258
- package/locales/sr.json +354 -357
- package/locales/sv.json +281 -284
- package/locales/sw.json +68 -71
- package/locales/ta.json +354 -357
- package/locales/te.json +352 -355
- package/locales/th.json +354 -357
- package/locales/tr.json +328 -331
- package/locales/uk.json +353 -356
- package/locales/ur.json +354 -357
- package/locales/uz.json +168 -171
- package/locales/vi.json +354 -357
- package/locales/zh-HK.json +354 -357
- package/locales/zh-TW.json +353 -356
- package/locales/zh.json +353 -356
- package/locales/zu.json +52 -55
- package/models/cpu_profile/CPUProfileDataModel.d.ts +0 -33
- package/models/cpu_profile/CPUProfileDataModel.js +517 -0
- package/models/cpu_profile/CPUProfileDataModel.js.map +1 -0
- package/models/cpu_profile/ProfileTreeModel.d.ts +1 -2
- package/models/cpu_profile/ProfileTreeModel.js +90 -0
- package/models/cpu_profile/ProfileTreeModel.js.map +1 -0
- package/models/cpu_profile/bundle-tsconfig.json +59 -0
- package/models/cpu_profile/bundle-tsconfig.ref.json +27 -0
- package/models/cpu_profile/cpu_profile-tsconfig.json +63 -0
- package/models/cpu_profile/cpu_profile-tsconfig.ref.json +31 -0
- package/models/cpu_profile/cpu_profile.js +7 -0
- package/models/cpu_profile/cpu_profile.js.map +1 -0
- package/models/cpu_profile/cpu_profile_node_typecheck-tsconfig.json +60 -0
- package/models/cpu_profile/cpu_profile_node_typecheck.stamp +0 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.json +63 -0
- package/models/cpu_profile/foundation_unittests-tsconfig.ref.json +30 -0
- package/models/cpu_profile/foundation_unittests_node_typecheck-tsconfig.json +59 -0
- package/models/crux-manager/crux-manager.d.ts +3 -1
- package/models/crux-manager/crux-manager.js +1 -0
- package/models/trace/EntityMapper.js +133 -0
- package/models/trace/EntityMapper.js.map +1 -0
- package/models/trace/EventsSerializer.d.ts +1 -0
- package/models/trace/EventsSerializer.js +113 -0
- package/models/trace/EventsSerializer.js.map +1 -0
- package/models/trace/LanternComputationData.js +394 -0
- package/models/trace/LanternComputationData.js.map +1 -0
- package/models/trace/ModelImpl.js +179 -0
- package/models/trace/ModelImpl.js.map +1 -0
- package/models/trace/Name.js +115 -0
- package/models/trace/Name.js.map +1 -0
- package/models/trace/Processor.js +616 -0
- package/models/trace/Processor.js.map +1 -0
- package/models/trace/Styles.d.ts +2 -2
- package/models/trace/Styles.js +836 -0
- package/models/trace/Styles.js.map +1 -0
- package/models/trace/bundle-tsconfig.json +77 -0
- package/models/trace/bundle-tsconfig.ref.json +45 -0
- package/models/trace/extras/FilmStrip.js +45 -0
- package/models/trace/extras/FilmStrip.js.map +1 -0
- package/models/trace/extras/Initiators.js +47 -0
- package/models/trace/extras/Initiators.js.map +1 -0
- package/models/trace/extras/MainThreadActivity.js +77 -0
- package/models/trace/extras/MainThreadActivity.js.map +1 -0
- package/models/trace/extras/ScriptDuplication.js +163 -0
- package/models/trace/extras/ScriptDuplication.js.map +1 -0
- package/models/trace/extras/StackTraceForEvent.js +192 -0
- package/models/trace/extras/StackTraceForEvent.js.map +1 -0
- package/models/trace/extras/ThirdParties.js +119 -0
- package/models/trace/extras/ThirdParties.js.map +1 -0
- package/models/trace/extras/TraceFilter.js +51 -0
- package/models/trace/extras/TraceFilter.js.map +1 -0
- package/models/trace/extras/TraceTree.js +678 -0
- package/models/trace/extras/TraceTree.js.map +1 -0
- package/models/trace/extras/bundle-tsconfig.json +59 -0
- package/models/trace/extras/bundle-tsconfig.ref.json +27 -0
- package/models/trace/extras/extras-tsconfig.json +81 -0
- package/models/trace/extras/extras-tsconfig.ref.json +49 -0
- package/models/trace/extras/extras.js +12 -0
- package/models/trace/extras/extras.js.map +1 -0
- package/models/trace/extras/extras_node_typecheck-tsconfig.json +78 -0
- package/models/trace/extras/extras_node_typecheck.stamp +0 -0
- package/models/trace/extras/foundation_unittests-tsconfig.json +91 -0
- package/models/trace/extras/foundation_unittests-tsconfig.ref.json +58 -0
- package/models/trace/extras/foundation_unittests_node_typecheck-tsconfig.json +87 -0
- package/models/trace/foundation_unittests-tsconfig.json +70 -0
- package/models/trace/foundation_unittests-tsconfig.ref.json +37 -0
- package/models/trace/foundation_unittests_node_typecheck-tsconfig.json +66 -0
- package/models/trace/handlers/AnimationFramesHandler.js +110 -0
- package/models/trace/handlers/AnimationFramesHandler.js.map +1 -0
- package/models/trace/handlers/AnimationHandler.js +27 -0
- package/models/trace/handlers/AnimationHandler.js.map +1 -0
- package/models/trace/handlers/AsyncJSCallsHandler.js +188 -0
- package/models/trace/handlers/AsyncJSCallsHandler.js.map +1 -0
- package/models/trace/handlers/DOMStatsHandler.js +22 -0
- package/models/trace/handlers/DOMStatsHandler.js.map +1 -0
- package/models/trace/handlers/ExtensionTraceDataHandler.js +264 -0
- package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -0
- package/models/trace/handlers/FlowsHandler.js +155 -0
- package/models/trace/handlers/FlowsHandler.js.map +1 -0
- package/models/trace/handlers/FramesHandler.js +491 -0
- package/models/trace/handlers/FramesHandler.js.map +1 -0
- package/models/trace/handlers/GPUHandler.js +36 -0
- package/models/trace/handlers/GPUHandler.js.map +1 -0
- package/models/trace/handlers/ImagePaintingHandler.js +148 -0
- package/models/trace/handlers/ImagePaintingHandler.js.map +1 -0
- package/models/trace/handlers/InitiatorsHandler.js +169 -0
- package/models/trace/handlers/InitiatorsHandler.js.map +1 -0
- package/models/trace/handlers/InvalidationsHandler.js +125 -0
- package/models/trace/handlers/InvalidationsHandler.js.map +1 -0
- package/models/trace/handlers/LargestImagePaintHandler.js +86 -0
- package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -0
- package/models/trace/handlers/LargestTextPaintHandler.js +28 -0
- package/models/trace/handlers/LargestTextPaintHandler.js.map +1 -0
- package/models/trace/handlers/LayerTreeHandler.js +104 -0
- package/models/trace/handlers/LayerTreeHandler.js.map +1 -0
- package/models/trace/handlers/LayoutShiftsHandler.js +449 -0
- package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -0
- package/models/trace/handlers/MemoryHandler.js +22 -0
- package/models/trace/handlers/MemoryHandler.js.map +1 -0
- package/models/trace/handlers/MetaHandler.js +442 -0
- package/models/trace/handlers/MetaHandler.js.map +1 -0
- package/models/trace/handlers/ModelHandlers.js +33 -0
- package/models/trace/handlers/ModelHandlers.js.map +1 -0
- package/models/trace/handlers/NetworkRequestsHandler.js +584 -0
- package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -0
- package/models/trace/handlers/PageFramesHandler.js +43 -0
- package/models/trace/handlers/PageFramesHandler.js.map +1 -0
- package/models/trace/handlers/PageLoadMetricsHandler.js +463 -0
- package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -0
- package/models/trace/handlers/RendererHandler.js +346 -0
- package/models/trace/handlers/RendererHandler.js.map +1 -0
- package/models/trace/handlers/SamplesHandler.js +264 -0
- package/models/trace/handlers/SamplesHandler.js.map +1 -0
- package/models/trace/handlers/ScreenshotsHandler.js +56 -0
- package/models/trace/handlers/ScreenshotsHandler.js.map +1 -0
- package/models/trace/handlers/ScriptsHandler.js +277 -0
- package/models/trace/handlers/ScriptsHandler.js.map +1 -0
- package/models/trace/handlers/SelectorStatsHandler.js +72 -0
- package/models/trace/handlers/SelectorStatsHandler.js.map +1 -0
- package/models/trace/handlers/Threads.js +108 -0
- package/models/trace/handlers/Threads.js.map +1 -0
- package/models/trace/handlers/UserInteractionsHandler.js +319 -0
- package/models/trace/handlers/UserInteractionsHandler.js.map +1 -0
- package/models/trace/handlers/UserTimingsHandler.js +194 -0
- package/models/trace/handlers/UserTimingsHandler.js.map +1 -0
- package/models/trace/handlers/WarningsHandler.js +135 -0
- package/models/trace/handlers/WarningsHandler.js.map +1 -0
- package/models/trace/handlers/WorkersHandler.js +34 -0
- package/models/trace/handlers/WorkersHandler.js.map +1 -0
- package/models/trace/handlers/bundle-tsconfig.json +59 -0
- package/models/trace/handlers/bundle-tsconfig.ref.json +27 -0
- package/models/trace/handlers/foundation_unittests-tsconfig.json +102 -0
- package/models/trace/handlers/foundation_unittests-tsconfig.ref.json +69 -0
- package/models/trace/handlers/foundation_unittests_node_typecheck-tsconfig.json +98 -0
- package/models/trace/handlers/handlers-tsconfig.json +112 -0
- package/models/trace/handlers/handlers-tsconfig.ref.json +80 -0
- package/models/trace/handlers/handlers.js +8 -0
- package/models/trace/handlers/handlers.js.map +1 -0
- package/models/trace/handlers/handlers_node_typecheck-tsconfig.json +109 -0
- package/models/trace/handlers/handlers_node_typecheck.stamp +0 -0
- package/models/trace/handlers/helpers.js +167 -0
- package/models/trace/handlers/helpers.js.map +1 -0
- package/models/trace/handlers/types.js +2 -0
- package/models/trace/handlers/types.js.map +1 -0
- package/models/trace/helpers/Extensions.js +42 -0
- package/models/trace/helpers/Extensions.js.map +1 -0
- package/models/trace/helpers/Network.js +103 -0
- package/models/trace/helpers/Network.js.map +1 -0
- package/models/trace/helpers/SamplesIntegrator.js +527 -0
- package/models/trace/helpers/SamplesIntegrator.js.map +1 -0
- package/models/trace/helpers/SyntheticEvents.d.ts +0 -8
- package/models/trace/helpers/SyntheticEvents.js +73 -0
- package/models/trace/helpers/SyntheticEvents.js.map +1 -0
- package/models/trace/helpers/Timing.js +200 -0
- package/models/trace/helpers/Timing.js.map +1 -0
- package/models/trace/helpers/Trace.js +844 -0
- package/models/trace/helpers/Trace.js.map +1 -0
- package/models/trace/helpers/TreeHelpers.js +255 -0
- package/models/trace/helpers/TreeHelpers.js.map +1 -0
- package/models/trace/helpers/bundle-tsconfig.json +59 -0
- package/models/trace/helpers/bundle-tsconfig.ref.json +27 -0
- package/models/trace/helpers/foundation_unittests-tsconfig.json +73 -0
- package/models/trace/helpers/foundation_unittests-tsconfig.ref.json +40 -0
- package/models/trace/helpers/foundation_unittests_node_typecheck-tsconfig.json +69 -0
- package/models/trace/helpers/helpers-tsconfig.json +77 -0
- package/models/trace/helpers/helpers-tsconfig.ref.json +45 -0
- package/models/trace/helpers/helpers.js +11 -0
- package/models/trace/helpers/helpers.js.map +1 -0
- package/models/trace/helpers/helpers_node_typecheck-tsconfig.json +74 -0
- package/models/trace/helpers/helpers_node_typecheck.stamp +0 -0
- package/models/trace/insights/CLSCulprits.d.ts +14 -14
- package/models/trace/insights/CLSCulprits.js +519 -0
- package/models/trace/insights/CLSCulprits.js.map +1 -0
- package/models/trace/insights/Cache.d.ts +6 -6
- package/models/trace/insights/Cache.js +210 -0
- package/models/trace/insights/Cache.js.map +1 -0
- package/models/trace/insights/CharacterSet.d.ts +8 -8
- package/models/trace/insights/CharacterSet.js +132 -0
- package/models/trace/insights/CharacterSet.js.map +1 -0
- package/models/trace/insights/Common.js +367 -0
- package/models/trace/insights/Common.js.map +1 -0
- package/models/trace/insights/DOMSize.d.ts +13 -13
- package/models/trace/insights/DOMSize.js +182 -0
- package/models/trace/insights/DOMSize.js.map +1 -0
- package/models/trace/insights/DocumentLatency.d.ts +11 -11
- package/models/trace/insights/DocumentLatency.js +259 -0
- package/models/trace/insights/DocumentLatency.js.map +1 -0
- package/models/trace/insights/DuplicatedJavaScript.d.ts +5 -5
- package/models/trace/insights/DuplicatedJavaScript.js +110 -0
- package/models/trace/insights/DuplicatedJavaScript.js.map +1 -0
- package/models/trace/insights/FontDisplay.d.ts +5 -5
- package/models/trace/insights/FontDisplay.js +93 -0
- package/models/trace/insights/FontDisplay.js.map +1 -0
- package/models/trace/insights/ForcedReflow.d.ts +7 -7
- package/models/trace/insights/ForcedReflow.js +162 -0
- package/models/trace/insights/ForcedReflow.js.map +1 -0
- package/models/trace/insights/INPBreakdown.d.ts +8 -8
- package/models/trace/insights/INPBreakdown.js +130 -0
- package/models/trace/insights/INPBreakdown.js.map +1 -0
- package/models/trace/insights/ImageDelivery.d.ts +12 -12
- package/models/trace/insights/ImageDelivery.js +264 -0
- package/models/trace/insights/ImageDelivery.js.map +1 -0
- package/models/trace/insights/LCPBreakdown.d.ts +11 -11
- package/models/trace/insights/LCPBreakdown.js +200 -0
- package/models/trace/insights/LCPBreakdown.js.map +1 -0
- package/models/trace/insights/LCPDiscovery.d.ts +10 -10
- package/models/trace/insights/LCPDiscovery.js +190 -0
- package/models/trace/insights/LCPDiscovery.js.map +1 -0
- package/models/trace/insights/LegacyJavaScript.d.ts +5 -5
- package/models/trace/insights/LegacyJavaScript.js +99 -0
- package/models/trace/insights/LegacyJavaScript.js.map +1 -0
- package/models/trace/insights/Models.js +23 -0
- package/models/trace/insights/Models.js.map +1 -0
- package/models/trace/insights/ModernHTTP.d.ts +5 -5
- package/models/trace/insights/ModernHTTP.js +205 -0
- package/models/trace/insights/ModernHTTP.js.map +1 -0
- package/models/trace/insights/NetworkDependencyTree.d.ts +19 -19
- package/models/trace/insights/NetworkDependencyTree.js +551 -0
- package/models/trace/insights/NetworkDependencyTree.js.map +1 -0
- package/models/trace/insights/RenderBlocking.d.ts +5 -5
- package/models/trace/insights/RenderBlocking.js +213 -0
- package/models/trace/insights/RenderBlocking.js.map +1 -0
- package/models/trace/insights/SlowCSSSelector.d.ts +10 -10
- package/models/trace/insights/SlowCSSSelector.js +140 -0
- package/models/trace/insights/SlowCSSSelector.js.map +1 -0
- package/models/trace/insights/Statistics.js +93 -0
- package/models/trace/insights/Statistics.js.map +1 -0
- package/models/trace/insights/ThirdParties.d.ts +6 -6
- package/models/trace/insights/ThirdParties.js +110 -0
- package/models/trace/insights/ThirdParties.js.map +1 -0
- package/models/trace/insights/Viewport.d.ts +3 -3
- package/models/trace/insights/Viewport.js +105 -0
- package/models/trace/insights/Viewport.js.map +1 -0
- package/models/trace/insights/bundle-tsconfig.json +59 -0
- package/models/trace/insights/bundle-tsconfig.ref.json +27 -0
- package/models/trace/insights/foundation_unittests-tsconfig.json +98 -0
- package/models/trace/insights/foundation_unittests-tsconfig.ref.json +65 -0
- package/models/trace/insights/foundation_unittests_node_typecheck-tsconfig.json +94 -0
- package/models/trace/insights/insights-tsconfig.json +114 -0
- package/models/trace/insights/insights-tsconfig.ref.json +82 -0
- package/models/trace/insights/insights.js +10 -0
- package/models/trace/insights/insights.js.map +1 -0
- package/models/trace/insights/insights_node_typecheck-tsconfig.json +111 -0
- package/models/trace/insights/insights_node_typecheck.stamp +0 -0
- package/models/trace/insights/types.d.ts +3 -3
- package/models/trace/insights/types.js +41 -0
- package/models/trace/insights/types.js.map +1 -0
- package/models/trace/lantern/bundle-tsconfig.json +71 -0
- package/models/trace/lantern/bundle-tsconfig.ref.json +39 -0
- package/models/trace/lantern/core/LanternError.js +7 -0
- package/models/trace/lantern/core/LanternError.js.map +1 -0
- package/models/trace/lantern/core/NetworkAnalyzer.js +496 -0
- package/models/trace/lantern/core/NetworkAnalyzer.js.map +1 -0
- package/models/trace/lantern/core/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/core/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/core/core-tsconfig.json +60 -0
- package/models/trace/lantern/core/core-tsconfig.ref.json +28 -0
- package/models/trace/lantern/core/core.js +6 -0
- package/models/trace/lantern/core/core.js.map +1 -0
- package/models/trace/lantern/core/core_node_typecheck-tsconfig.json +57 -0
- package/models/trace/lantern/core/core_node_typecheck.stamp +0 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.json +69 -0
- package/models/trace/lantern/core/foundation_unittests-tsconfig.ref.json +36 -0
- package/models/trace/lantern/core/foundation_unittests_node_typecheck-tsconfig.json +65 -0
- package/models/trace/lantern/graph/BaseNode.d.ts +2 -2
- package/models/trace/lantern/graph/BaseNode.js +277 -0
- package/models/trace/lantern/graph/BaseNode.js.map +1 -0
- package/models/trace/lantern/graph/CPUNode.js +80 -0
- package/models/trace/lantern/graph/CPUNode.js.map +1 -0
- package/models/trace/lantern/graph/NetworkNode.js +95 -0
- package/models/trace/lantern/graph/NetworkNode.js.map +1 -0
- package/models/trace/lantern/graph/PageDependencyGraph.js +574 -0
- package/models/trace/lantern/graph/PageDependencyGraph.js.map +1 -0
- package/models/trace/lantern/graph/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/graph/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.json +61 -0
- package/models/trace/lantern/graph/foundation_unittests-tsconfig.ref.json +28 -0
- package/models/trace/lantern/graph/foundation_unittests_node_typecheck-tsconfig.json +57 -0
- package/models/trace/lantern/graph/graph-tsconfig.json +65 -0
- package/models/trace/lantern/graph/graph-tsconfig.ref.json +33 -0
- package/models/trace/lantern/graph/graph.js +8 -0
- package/models/trace/lantern/graph/graph.js.map +1 -0
- package/models/trace/lantern/graph/graph_node_typecheck-tsconfig.json +62 -0
- package/models/trace/lantern/graph/graph_node_typecheck.stamp +0 -0
- package/models/trace/lantern/lantern.js +10 -0
- package/models/trace/lantern/lantern.js.map +1 -0
- package/models/trace/lantern/metrics/FirstContentfulPaint.js +137 -0
- package/models/trace/lantern/metrics/FirstContentfulPaint.js.map +1 -0
- package/models/trace/lantern/metrics/Interactive.js +68 -0
- package/models/trace/lantern/metrics/Interactive.js.map +1 -0
- package/models/trace/lantern/metrics/LargestContentfulPaint.d.ts +5 -1
- package/models/trace/lantern/metrics/LargestContentfulPaint.js +187 -0
- package/models/trace/lantern/metrics/LargestContentfulPaint.js.map +1 -0
- package/models/trace/lantern/metrics/MaxPotentialFID.js +49 -0
- package/models/trace/lantern/metrics/MaxPotentialFID.js.map +1 -0
- package/models/trace/lantern/metrics/Metric.js +69 -0
- package/models/trace/lantern/metrics/Metric.js.map +1 -0
- package/models/trace/lantern/metrics/SpeedIndex.js +102 -0
- package/models/trace/lantern/metrics/SpeedIndex.js.map +1 -0
- package/models/trace/lantern/metrics/TBTUtils.js +65 -0
- package/models/trace/lantern/metrics/TBTUtils.js.map +1 -0
- package/models/trace/lantern/metrics/TotalBlockingTime.js +79 -0
- package/models/trace/lantern/metrics/TotalBlockingTime.js.map +1 -0
- package/models/trace/lantern/metrics/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/metrics/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.json +76 -0
- package/models/trace/lantern/metrics/foundation_unittests-tsconfig.ref.json +43 -0
- package/models/trace/lantern/metrics/foundation_unittests_node_typecheck-tsconfig.json +72 -0
- package/models/trace/lantern/metrics/metrics-tsconfig.json +75 -0
- package/models/trace/lantern/metrics/metrics-tsconfig.ref.json +43 -0
- package/models/trace/lantern/metrics/metrics.js +12 -0
- package/models/trace/lantern/metrics/metrics.js.map +1 -0
- package/models/trace/lantern/metrics/metrics_node_typecheck-tsconfig.json +72 -0
- package/models/trace/lantern/metrics/metrics_node_typecheck.stamp +0 -0
- package/models/trace/lantern/simulation/ConnectionPool.js +116 -0
- package/models/trace/lantern/simulation/ConnectionPool.js.map +1 -0
- package/models/trace/lantern/simulation/Constants.js +45 -0
- package/models/trace/lantern/simulation/Constants.js.map +1 -0
- package/models/trace/lantern/simulation/DNSCache.js +48 -0
- package/models/trace/lantern/simulation/DNSCache.js.map +1 -0
- package/models/trace/lantern/simulation/SimulationTimingMap.js +135 -0
- package/models/trace/lantern/simulation/SimulationTimingMap.js.map +1 -0
- package/models/trace/lantern/simulation/Simulator.js +461 -0
- package/models/trace/lantern/simulation/Simulator.js.map +1 -0
- package/models/trace/lantern/simulation/TCPConnection.js +155 -0
- package/models/trace/lantern/simulation/TCPConnection.js.map +1 -0
- package/models/trace/lantern/simulation/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/simulation/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.json +75 -0
- package/models/trace/lantern/simulation/foundation_unittests-tsconfig.ref.json +42 -0
- package/models/trace/lantern/simulation/foundation_unittests_node_typecheck-tsconfig.json +71 -0
- package/models/trace/lantern/simulation/simulation-tsconfig.json +70 -0
- package/models/trace/lantern/simulation/simulation-tsconfig.ref.json +38 -0
- package/models/trace/lantern/simulation/simulation.js +10 -0
- package/models/trace/lantern/simulation/simulation.js.map +1 -0
- package/models/trace/lantern/simulation/simulation_node_typecheck-tsconfig.json +67 -0
- package/models/trace/lantern/simulation/simulation_node_typecheck.stamp +0 -0
- package/models/trace/lantern/testing/bundle-tsconfig.json +60 -0
- package/models/trace/lantern/testing/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/testing/testing-tsconfig.json +63 -0
- package/models/trace/lantern/testing/testing-tsconfig.ref.json +30 -0
- package/models/trace/lantern/types/Lantern.d.ts +23 -19
- package/models/trace/lantern/types/Lantern.js +25 -0
- package/models/trace/lantern/types/Lantern.js.map +1 -0
- package/models/trace/lantern/types/bundle-tsconfig.json +59 -0
- package/models/trace/lantern/types/bundle-tsconfig.ref.json +27 -0
- package/models/trace/lantern/types/types-tsconfig.json +59 -0
- package/models/trace/lantern/types/types-tsconfig.ref.json +27 -0
- package/models/trace/lantern/types/types.js +5 -0
- package/models/trace/lantern/types/types.js.map +1 -0
- package/models/trace/lantern/types/types_node_typecheck-tsconfig.json +56 -0
- package/models/trace/lantern/types/types_node_typecheck.stamp +0 -0
- package/models/trace/trace-tsconfig.json +89 -0
- package/models/trace/trace-tsconfig.ref.json +57 -0
- package/models/trace/trace.js +16 -544
- package/models/trace/trace.js.map +1 -0
- package/models/trace/trace_node_typecheck-tsconfig.json +86 -0
- package/models/trace/trace_node_typecheck.stamp +0 -0
- package/models/trace/types/Configuration.d.ts +2 -2
- package/models/trace/types/Configuration.js +19 -0
- package/models/trace/types/Configuration.js.map +1 -0
- package/models/trace/types/Extensions.d.ts +1 -1
- package/models/trace/types/Extensions.js +38 -0
- package/models/trace/types/Extensions.js.map +1 -0
- package/models/trace/types/File.d.ts +9 -3
- package/models/trace/types/File.js +92 -0
- package/models/trace/types/File.js.map +1 -0
- package/models/trace/types/Overlays.js +5 -0
- package/models/trace/types/Overlays.js.map +1 -0
- package/models/trace/types/Timing.js +16 -0
- package/models/trace/types/Timing.js.map +1 -0
- package/models/trace/types/TraceEvents.d.ts +21 -16
- package/models/trace/types/TraceEvents.js +983 -0
- package/models/trace/types/TraceEvents.js.map +1 -0
- package/models/trace/types/bundle-tsconfig.json +59 -0
- package/models/trace/types/bundle-tsconfig.ref.json +27 -0
- package/models/trace/types/foundation_unittests-tsconfig.json +67 -0
- package/models/trace/types/foundation_unittests-tsconfig.ref.json +34 -0
- package/models/trace/types/foundation_unittests_node_typecheck-tsconfig.json +63 -0
- package/models/trace/types/types-tsconfig.json +76 -0
- package/models/trace/types/types-tsconfig.ref.json +44 -0
- package/models/trace/types/types.js +10 -0
- package/models/trace/types/types.js.map +1 -0
- package/models/trace/types/types_node_typecheck-tsconfig.json +73 -0
- package/models/trace/types/types_node_typecheck.stamp +0 -0
- package/package.json +8 -40
- package/test/invalid-animation-events.json.gz +0 -0
- package/test/test-trace-engine.mjs +191 -0
- package/third_party/legacy-javascript/bundle-tsconfig.json +59 -0
- package/third_party/legacy-javascript/bundle-tsconfig.ref.json +27 -0
- package/third_party/legacy-javascript/legacy-javascript-tsconfig.ref.json +15 -0
- package/third_party/legacy-javascript/legacy-javascript.js +3 -0
- package/third_party/legacy-javascript/legacy-javascript.js.map +1 -0
- package/third_party/legacy-javascript/lib/legacy-javascript.js +1119 -0
- package/third_party/marked/marked.d.ts +1 -2
- package/third_party/marked/marked.js +1 -0
- package/third_party/third-party-web/third-party-web.d.ts +1 -2
- package/third_party/third-party-web/third-party-web.js +1 -0
- package/tsconfig.json +29 -0
- package/core/common/Base64.d.ts +0 -12
- package/core/common/CharacterIdMap.d.ts +0 -5
- package/core/common/Color.d.ts +0 -357
- package/core/common/ColorConverter.d.ts +0 -26
- package/core/common/ColorUtils.d.ts +0 -45
- package/core/common/Console.d.ts +0 -54
- package/core/common/Debouncer.d.ts +0 -8
- package/core/common/EventTarget.d.ts +0 -22
- package/core/common/Gzip.d.ts +0 -23
- package/core/common/JavaScriptMetaData.d.ts +0 -20
- package/core/common/Lazy.d.ts +0 -4
- package/core/common/MapWithDefault.d.ts +0 -9
- package/core/common/Mutex.d.ts +0 -13
- package/core/common/Object.d.ts +0 -20
- package/core/common/Progress.d.ts +0 -47
- package/core/common/ResolverBase.d.ts +0 -29
- package/core/common/ResourceType.d.ts +0 -52
- package/core/common/ReturnToPanel.d.ts +0 -10
- package/core/common/Revealer.d.ts +0 -66
- package/core/common/Runnable.d.ts +0 -14
- package/core/common/SegmentedRange.d.ts +0 -14
- package/core/common/SettingRegistration.d.ts +0 -136
- package/core/common/Settings.d.ts +0 -228
- package/core/common/SimpleHistoryManager.d.ts +0 -20
- package/core/common/Srcset.d.ts +0 -16
- package/core/common/StringOutputStream.d.ts +0 -10
- package/core/common/TextDictionary.d.ts +0 -11
- package/core/common/Throttler.d.ts +0 -12
- package/core/common/Trie.d.ts +0 -24
- package/core/common/VersionController.d.ts +0 -85
- package/core/host/AidaClient.d.ts +0 -73
- package/core/host/AidaClientTypes.d.ts +0 -355
- package/core/host/AidaGcaTranslation.d.ts +0 -10
- package/core/host/DispatchHttpRequestClient.d.ts +0 -14
- package/core/host/GcaClient.d.ts +0 -14
- package/core/host/GcaTypes.d.ts +0 -411
- package/core/host/GdpClient.d.ts +0 -84
- package/core/host/InspectorFrontendHost.d.ts +0 -29
- package/core/host/InspectorFrontendHostAPI.d.ts +0 -425
- package/core/host/InspectorFrontendHostStub.d.ts +0 -151
- package/core/host/Platform.d.ts +0 -16
- package/core/host/ResourceLoader.d.ts +0 -15
- package/core/host/UserMetrics.d.ts +0 -116
- package/core/host/UserMetricsEnums.d.ts +0 -888
- package/core/i18n/ByteUtilities.d.ts +0 -11
- package/core/i18n/DevToolsLocale.d.ts +0 -41
- package/core/i18n/NumberFormatter.d.ts +0 -11
- package/core/i18n/i18nImpl.d.ts +0 -64
- package/core/i18n/i18nTypes.d.ts +0 -5
- package/core/i18n/locales.d.ts +0 -15
- package/core/i18n/time-utilities.d.ts +0 -16
- package/core/platform/browser/HostRuntime.d.ts +0 -2
- package/core/platform/browser/browser.d.ts +0 -2
- package/core/platform/node/HostRuntime.d.ts +0 -2
- package/core/platform/node/node.d.ts +0 -2
- package/core/protocol_client/CDPConnection.d.ts +0 -77
- package/core/protocol_client/ConnectionTransport.d.ts +0 -9
- package/core/protocol_client/DevToolsCDPConnection.d.ts +0 -16
- package/core/protocol_client/InspectorBackend.d.ts +0 -223
- package/core/protocol_client/protocol_client.d.ts +0 -5
- package/core/root/DevToolsContext.d.ts +0 -34
- package/core/root/ExperimentNames.d.ts +0 -9
- package/core/root/Runtime.d.ts +0 -353
- package/core/sdk/AccessibilityModel.d.ts +0 -76
- package/core/sdk/AnimationModel.d.ts +0 -161
- package/core/sdk/AutofillModel.d.ts +0 -23
- package/core/sdk/CPUProfilerModel.d.ts +0 -46
- package/core/sdk/CPUThrottlingManager.d.ts +0 -47
- package/core/sdk/CSSContainerQuery.d.ts +0 -42
- package/core/sdk/CSSFontFace.d.ts +0 -10
- package/core/sdk/CSSLayer.d.ts +0 -9
- package/core/sdk/CSSLocation.d.ts +0 -14
- package/core/sdk/CSSMatchedStyles.d.ts +0 -138
- package/core/sdk/CSSMedia.d.ts +0 -36
- package/core/sdk/CSSMetadata.d.ts +0 -87
- package/core/sdk/CSSModel.d.ts +0 -185
- package/core/sdk/CSSNavigation.d.ts +0 -10
- package/core/sdk/CSSProperty.d.ts +0 -53
- package/core/sdk/CSSPropertyParser.d.ts +0 -126
- package/core/sdk/CSSPropertyParserMatchers.d.ts +0 -442
- package/core/sdk/CSSQuery.d.ts +0 -22
- package/core/sdk/CSSRule.d.ts +0 -132
- package/core/sdk/CSSScope.d.ts +0 -9
- package/core/sdk/CSSStartingStyle.d.ts +0 -9
- package/core/sdk/CSSStyleDeclaration.d.ts +0 -38
- package/core/sdk/CSSStyleSheetHeader.d.ts +0 -53
- package/core/sdk/CSSSupports.d.ts +0 -10
- package/core/sdk/CategorizedBreakpoint.d.ts +0 -42
- package/core/sdk/ChildTargetManager.d.ts +0 -40
- package/core/sdk/CompilerSourceMappingContentProvider.d.ts +0 -12
- package/core/sdk/Connections.d.ts +0 -36
- package/core/sdk/ConsoleModel.d.ts +0 -127
- package/core/sdk/ConsoleModelTypes.d.ts +0 -6
- package/core/sdk/Cookie.d.ts +0 -68
- package/core/sdk/CookieModel.d.ts +0 -31
- package/core/sdk/CookieParser.d.ts +0 -14
- package/core/sdk/CrashReportContextModel.d.ts +0 -8
- package/core/sdk/DOMDebuggerModel.d.ts +0 -127
- package/core/sdk/DOMModel.d.ts +0 -440
- package/core/sdk/DOMStorageModel.d.ts +0 -79
- package/core/sdk/DebuggerModel.d.ts +0 -305
- package/core/sdk/EmulationModel.d.ts +0 -95
- package/core/sdk/EnhancedTracesParser.d.ts +0 -105
- package/core/sdk/EventBreakpointsModel.d.ts +0 -66
- package/core/sdk/FrameAssociated.d.ts +0 -6
- package/core/sdk/FrameManager.d.ts +0 -68
- package/core/sdk/HeapProfilerModel.d.ts +0 -75
- package/core/sdk/HttpReasonPhraseStrings.d.ts +0 -5
- package/core/sdk/IOModel.d.ts +0 -10
- package/core/sdk/IsolateManager.d.ts +0 -53
- package/core/sdk/IssuesModel.d.ts +0 -28
- package/core/sdk/LayerTreeBase.d.ts +0 -70
- package/core/sdk/LogModel.d.ts +0 -20
- package/core/sdk/NetworkManager.d.ts +0 -418
- package/core/sdk/NetworkRequest.d.ts +0 -497
- package/core/sdk/NetworkRequestAccess.d.ts +0 -91
- package/core/sdk/OverlayColorGenerator.d.ts +0 -14
- package/core/sdk/OverlayModel.d.ts +0 -186
- package/core/sdk/OverlayPersistentHighlighter.d.ts +0 -116
- package/core/sdk/PageFunctions.d.ts +0 -22
- package/core/sdk/PageLoad.d.ts +0 -14
- package/core/sdk/PageResourceLoader.d.ts +0 -111
- package/core/sdk/PaintProfiler.d.ts +0 -43
- package/core/sdk/PerformanceMetricsModel.d.ts +0 -12
- package/core/sdk/PreloadingModel.d.ts +0 -146
- package/core/sdk/RehydratingConnection.d.ts +0 -73
- package/core/sdk/RehydratingObject.d.ts +0 -59
- package/core/sdk/RemoteObject.d.ts +0 -210
- package/core/sdk/Resource.d.ts +0 -36
- package/core/sdk/ResourceTreeModel.d.ts +0 -280
- package/core/sdk/RuntimeModel.d.ts +0 -164
- package/core/sdk/SDKModel.d.ts +0 -30
- package/core/sdk/SDKSettings.d.ts +0 -54
- package/core/sdk/ScopeTreeCache.d.ts +0 -21
- package/core/sdk/ScreenCaptureModel.d.ts +0 -69
- package/core/sdk/Script.d.ts +0 -134
- package/core/sdk/SecurityOrigin.d.ts +0 -108
- package/core/sdk/SecurityOriginManager.d.ts +0 -23
- package/core/sdk/ServerSentEvents.d.ts +0 -18
- package/core/sdk/ServerSentEventsProtocol.d.ts +0 -18
- package/core/sdk/ServerTiming.d.ts +0 -24
- package/core/sdk/ServiceWorkerCacheModel.d.ts +0 -71
- package/core/sdk/ServiceWorkerManager.d.ts +0 -125
- package/core/sdk/SourceMap.d.ts +0 -211
- package/core/sdk/SourceMapCache.d.ts +0 -12
- package/core/sdk/SourceMapFunctionRanges.d.ts +0 -23
- package/core/sdk/SourceMapManager.d.ts +0 -46
- package/core/sdk/SourceMapRangeMappings.d.ts +0 -15
- package/core/sdk/SourceMapScopeChainEntry.d.ts +0 -23
- package/core/sdk/SourceMapScopesInfo.d.ts +0 -184
- package/core/sdk/StorageBucketsModel.d.ts +0 -48
- package/core/sdk/StorageKeyManager.d.ts +0 -38
- package/core/sdk/Target.d.ts +0 -79
- package/core/sdk/TargetManager.d.ts +0 -92
- package/core/sdk/TraceObject.d.ts +0 -43
- package/core/sdk/WebAuthnModel.d.ts +0 -29
- package/core/text_utils/CodeMirrorUtils.d.ts +0 -3
- package/core/text_utils/ContentData.d.ts +0 -94
- package/core/text_utils/ContentProvider.d.ts +0 -42
- package/core/text_utils/Markdown.d.ts +0 -13
- package/core/text_utils/StaticContentProvider.d.ts +0 -13
- package/core/text_utils/StreamingContentData.d.ts +0 -49
- package/core/text_utils/Text.d.ts +0 -19
- package/core/text_utils/TextCursor.d.ts +0 -9
- package/core/text_utils/TextRange.d.ts +0 -81
- package/core/text_utils/TextUtils.d.ts +0 -97
- package/core/text_utils/WasmDisassembly.d.ts +0 -29
- package/core/text_utils/text_utils.d.ts +0 -12
- package/entrypoints/formatter_actions/formatter_actions.d.ts +0 -65
- package/generated/InspectorBackendCommands.d.ts +0 -14
- package/generated/SupportedCSSProperties.d.ts +0 -18
- package/generated/protocol-mapping.d.ts +0 -5985
- package/generated/protocol-proxy-api.d.ts +0 -5447
- package/index.d.ts +0 -2
- package/index.js +0 -6
- package/models/crux-manager/CrUXManager.d.ts +0 -107
- package/models/emulation/DeviceModeModel.d.ts +0 -157
- package/models/emulation/EmulatedDevices.d.ts +0 -148
- package/models/emulation/emulation.d.ts +0 -3
- package/models/formatter/FormatterWorkerPool.d.ts +0 -58
- package/models/formatter/ScriptFormatter.d.ts +0 -11
- package/models/formatter/formatter.d.ts +0 -3
- package/third_party/codemirror.next/codemirror.next.d.ts +0 -9196
- package/third_party/i18n/i18n-impl.d.ts +0 -25
- package/third_party/i18n/i18n.d.ts +0 -3
- package/third_party/i18n/localized-string-set.d.ts +0 -49
- package/third_party/intl-messageformat/intl-messageformat.d.ts +0 -1
- package/third_party/marked/package/lib/marked.esm.d.ts +0 -760
- package/third_party/source-map-scopes-codec/package/src/builder/builder.d.ts +0 -70
- package/third_party/source-map-scopes-codec/package/src/builder/safe_builder.d.ts +0 -40
- package/third_party/source-map-scopes-codec/package/src/codec.d.ts +0 -49
- package/third_party/source-map-scopes-codec/package/src/decode/decode.d.ts +0 -33
- package/third_party/source-map-scopes-codec/package/src/encode/encode.d.ts +0 -8
- package/third_party/source-map-scopes-codec/package/src/encode/encoder.d.ts +0 -9
- package/third_party/source-map-scopes-codec/package/src/mod.d.ts +0 -5
- package/third_party/source-map-scopes-codec/package/src/scopes.d.ts +0 -169
- package/third_party/source-map-scopes-codec/package/src/util.d.ts +0 -5
- package/third_party/source-map-scopes-codec/package/src/vlq.d.ts +0 -14
- package/third_party/source-map-scopes-codec/source-map-scopes-codec.d.ts +0 -1
- package/third_party/third-party-web/lib/nostats-subset.d.ts +0 -2
- package/third_party/third-party-web/package/lib/index.d.ts +0 -34
- package/third_party/third-party-web/package/lib/subsets/nostats.d.ts +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
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
|
+
import * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party-web.js';
|
|
5
|
+
import * as Helpers from '../helpers/helpers.js';
|
|
6
|
+
import * as Types from '../types/types.js';
|
|
7
|
+
export function getEntityForEvent(event, entityMappings) {
|
|
8
|
+
const url = getNonResolvedURL(event);
|
|
9
|
+
if (!url) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
return getEntityForUrl(url, entityMappings);
|
|
13
|
+
}
|
|
14
|
+
export function getEntityForUrl(url, entityMappings) {
|
|
15
|
+
const cachedByUrl = entityMappings.entityByUrlCache.get(url);
|
|
16
|
+
if (cachedByUrl) {
|
|
17
|
+
return cachedByUrl;
|
|
18
|
+
}
|
|
19
|
+
const entity = ThirdPartyWeb.ThirdPartyWeb.getEntity(url) ?? makeUpEntity(entityMappings.createdEntityCache, url);
|
|
20
|
+
if (entity) {
|
|
21
|
+
entityMappings.entityByUrlCache.set(url, entity);
|
|
22
|
+
}
|
|
23
|
+
return entity;
|
|
24
|
+
}
|
|
25
|
+
export function getNonResolvedURL(entry, handlerData) {
|
|
26
|
+
if (Types.Events.isProfileCall(entry)) {
|
|
27
|
+
return entry.callFrame.url;
|
|
28
|
+
}
|
|
29
|
+
if (Types.Events.isSyntheticNetworkRequest(entry)) {
|
|
30
|
+
return entry.args.data.url;
|
|
31
|
+
}
|
|
32
|
+
if (Types.Events.isParseAuthorStyleSheetEvent(entry) && entry.args) {
|
|
33
|
+
return entry.args.data.styleSheetUrl;
|
|
34
|
+
}
|
|
35
|
+
const data = Helpers.Trace.getEventDataObject(entry);
|
|
36
|
+
if (data && Array.isArray(data.stackTrace) && data.stackTrace.length > 0 &&
|
|
37
|
+
typeof data.stackTrace[0]?.url === 'string') {
|
|
38
|
+
return data.stackTrace[0].url;
|
|
39
|
+
}
|
|
40
|
+
// ParseHTML events store the URL under beginData, not data.
|
|
41
|
+
if (Types.Events.isParseHTML(entry)) {
|
|
42
|
+
return entry.args.beginData.url;
|
|
43
|
+
}
|
|
44
|
+
if (handlerData) {
|
|
45
|
+
// DecodeImage events use the URL from the relevant PaintImage event.
|
|
46
|
+
if (Types.Events.isDecodeImage(entry)) {
|
|
47
|
+
const paintEvent = handlerData.ImagePainting.paintImageForEvent.get(entry);
|
|
48
|
+
return paintEvent ? getNonResolvedURL(paintEvent, handlerData) : null;
|
|
49
|
+
}
|
|
50
|
+
// DrawLazyPixelRef events use the URL from the relevant PaintImage event.
|
|
51
|
+
if (Types.Events.isDrawLazyPixelRef(entry) && entry.args?.LazyPixelRef) {
|
|
52
|
+
const paintEvent = handlerData.ImagePainting.paintImageByDrawLazyPixelRef.get(entry.args.LazyPixelRef);
|
|
53
|
+
return paintEvent ? getNonResolvedURL(paintEvent, handlerData) : null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// For all other events, try to see if the URL is provided, else return null.
|
|
57
|
+
if (data && typeof data.url === 'string' && data.url) {
|
|
58
|
+
return data.url;
|
|
59
|
+
}
|
|
60
|
+
// Many events don't have a url, but are associated with a request. Use the
|
|
61
|
+
// request's url.
|
|
62
|
+
const requestId = data && typeof data.requestId === 'string' ? data.requestId : undefined;
|
|
63
|
+
if (handlerData && requestId) {
|
|
64
|
+
const url = handlerData.NetworkRequests.byId.get(requestId)?.args.data.url;
|
|
65
|
+
if (url) {
|
|
66
|
+
return url;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
export function makeUpEntity(entityCache, url) {
|
|
72
|
+
if (url.startsWith('chrome-extension:')) {
|
|
73
|
+
return makeUpChromeExtensionEntity(entityCache, url);
|
|
74
|
+
}
|
|
75
|
+
// Make up an entity only for valid http/https URLs.
|
|
76
|
+
if (!url.startsWith('http')) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// NOTE: Lighthouse uses a tld database to determine the root domain, but here
|
|
80
|
+
// we are using third party web's database. Doesn't really work for the case of classifying
|
|
81
|
+
// domains 3pweb doesn't know about, so it will just give us a guess.
|
|
82
|
+
const rootDomain = ThirdPartyWeb.ThirdPartyWeb.getRootDomain(url);
|
|
83
|
+
if (!rootDomain) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (entityCache.has(rootDomain)) {
|
|
87
|
+
return entityCache.get(rootDomain);
|
|
88
|
+
}
|
|
89
|
+
const unrecognizedEntity = {
|
|
90
|
+
name: rootDomain,
|
|
91
|
+
company: rootDomain,
|
|
92
|
+
category: '',
|
|
93
|
+
categories: [],
|
|
94
|
+
domains: [rootDomain],
|
|
95
|
+
averageExecutionTime: 0,
|
|
96
|
+
totalExecutionTime: 0,
|
|
97
|
+
totalOccurrences: 0,
|
|
98
|
+
isUnrecognized: true,
|
|
99
|
+
};
|
|
100
|
+
entityCache.set(rootDomain, unrecognizedEntity);
|
|
101
|
+
return unrecognizedEntity;
|
|
102
|
+
}
|
|
103
|
+
function getChromeExtensionOrigin(url) {
|
|
104
|
+
return url.protocol + '//' + url.host;
|
|
105
|
+
}
|
|
106
|
+
function makeUpChromeExtensionEntity(entityCache, url, extensionName) {
|
|
107
|
+
const parsedUrl = new URL(url);
|
|
108
|
+
const origin = getChromeExtensionOrigin(parsedUrl);
|
|
109
|
+
const host = new URL(origin).host;
|
|
110
|
+
const name = extensionName || host;
|
|
111
|
+
const cachedEntity = entityCache.get(origin);
|
|
112
|
+
if (cachedEntity) {
|
|
113
|
+
return cachedEntity;
|
|
114
|
+
}
|
|
115
|
+
const chromeExtensionEntity = {
|
|
116
|
+
name,
|
|
117
|
+
company: name,
|
|
118
|
+
category: 'Chrome Extension',
|
|
119
|
+
homepage: 'https://chromewebstore.google.com/detail/' + host,
|
|
120
|
+
categories: [],
|
|
121
|
+
domains: [origin],
|
|
122
|
+
averageExecutionTime: 0,
|
|
123
|
+
totalExecutionTime: 0,
|
|
124
|
+
totalOccurrences: 0,
|
|
125
|
+
};
|
|
126
|
+
entityCache.set(origin, chromeExtensionEntity);
|
|
127
|
+
return chromeExtensionEntity;
|
|
128
|
+
}
|
|
129
|
+
export function addEventToEntityMapping(event, entityMappings) {
|
|
130
|
+
// As we share the entityMappings between Network and Renderer... We can have ResourceSendRequest events passed in here
|
|
131
|
+
// that were already mapped in Network. So, to avoid mapping twice, we always check that we didn't yet.
|
|
132
|
+
if (entityMappings.entityByEvent.has(event)) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const entity = getEntityForEvent(event, entityMappings);
|
|
136
|
+
if (!entity) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const mappedEvents = entityMappings.eventsByEntity.get(entity);
|
|
140
|
+
if (mappedEvents) {
|
|
141
|
+
mappedEvents.push(event);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
entityMappings.eventsByEntity.set(entity, [event]);
|
|
145
|
+
}
|
|
146
|
+
entityMappings.entityByEvent.set(event, entity);
|
|
147
|
+
}
|
|
148
|
+
/** A slight upgrade of addEventToEntityMapping to handle the sub-events of a network request. **/
|
|
149
|
+
export function addNetworkRequestToEntityMapping(networkRequest, entityMappings, requestTraceEvents) {
|
|
150
|
+
const entity = getEntityForEvent(networkRequest, entityMappings);
|
|
151
|
+
if (!entity) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
// In addition to mapping the network request, we'll also assign this entity to its "child" instant events like receiveData, willSendRequest, finishLoading, etc,
|
|
155
|
+
const eventsToMap = [networkRequest, ...Object.values(requestTraceEvents).flat()];
|
|
156
|
+
const mappedEvents = entityMappings.eventsByEntity.get(entity);
|
|
157
|
+
if (mappedEvents) {
|
|
158
|
+
mappedEvents.push(...eventsToMap);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
entityMappings.eventsByEntity.set(entity, eventsToMap);
|
|
162
|
+
}
|
|
163
|
+
for (const evt of eventsToMap) {
|
|
164
|
+
entityMappings.entityByEvent.set(evt, entity);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/helpers.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,aAAa,MAAM,yDAAyD,CAAC;AACzF,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAgB3C,MAAM,UAAU,iBAAiB,CAAC,KAAyB,EAAE,cAA8B;IACzF,MAAM,GAAG,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO;IACT,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,cAA8B;IACzE,MAAM,WAAW,GAAG,cAAc,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7D,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,cAAc,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAClH,IAAI,MAAM,EAAE,CAAC;QACX,cAAc,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC7B,KAAyB,EAA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,kBAAgD;IAClD,MAAM,MAAM,GAAG,iBAAiB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;IACjE,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;IACT,CAAC;IACD,iKAAiK;IACjK,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAClF,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/D,IAAI,YAAY,EAAE,CAAC;QACjB,YAAY,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;IACpC,CAAC;SAAM,CAAC;QACN,cAAc,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACzD,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../../core/platform/platform.js';\nimport * as ThirdPartyWeb from '../../../third_party/third-party-web/third-party-web.js';\nimport * as Helpers from '../helpers/helpers.js';\nimport * as Types from '../types/types.js';\n\nimport type {TraceEventsForNetworkRequest} from './NetworkRequestsHandler.js';\nimport type {HandlerData} from './types.js';\n\nexport type Entity = typeof ThirdPartyWeb.ThirdPartyWeb.entities[number]&{\n isUnrecognized?: boolean,\n};\n\nexport interface EntityMappings {\n createdEntityCache: Map<string, Entity>;\n entityByEvent: Map<Types.Events.Event, Entity>;\n eventsByEntity: Map<Entity, Types.Events.Event[]>;\n entityByUrlCache: Map<string, Entity>;\n}\n\nexport function getEntityForEvent(event: Types.Events.Event, entityMappings: EntityMappings): Entity|undefined {\n const url = getNonResolvedURL(event);\n if (!url) {\n return;\n }\n return getEntityForUrl(url, entityMappings);\n}\n\nexport function getEntityForUrl(url: string, entityMappings: EntityMappings): Entity|undefined {\n const cachedByUrl = entityMappings.entityByUrlCache.get(url);\n if (cachedByUrl) {\n return cachedByUrl;\n }\n const entity = ThirdPartyWeb.ThirdPartyWeb.getEntity(url) ?? makeUpEntity(entityMappings.createdEntityCache, url);\n if (entity) {\n entityMappings.entityByUrlCache.set(url, entity);\n }\n return entity;\n}\n\nexport function getNonResolvedURL(\n entry: Types.Events.Event, handlerData?: HandlerData): Platform.DevToolsPath.UrlString|null {\n if (Types.Events.isProfileCall(entry)) {\n return entry.callFrame.url as Platform.DevToolsPath.UrlString;\n }\n\n if (Types.Events.isSyntheticNetworkRequest(entry)) {\n return entry.args.data.url as Platform.DevToolsPath.UrlString;\n }\n\n if (Types.Events.isParseAuthorStyleSheetEvent(entry) && entry.args) {\n return entry.args.data.styleSheetUrl as Platform.DevToolsPath.UrlString;\n }\n\n const data = Helpers.Trace.getEventDataObject(entry);\n if (data && Array.isArray(data.stackTrace) && data.stackTrace.length > 0 &&\n typeof data.stackTrace[0]?.url === 'string') {\n return data.stackTrace[0].url as Platform.DevToolsPath.UrlString;\n }\n\n // ParseHTML events store the URL under beginData, not data.\n if (Types.Events.isParseHTML(entry)) {\n return entry.args.beginData.url as Platform.DevToolsPath.UrlString;\n }\n\n if (handlerData) {\n // DecodeImage events use the URL from the relevant PaintImage event.\n if (Types.Events.isDecodeImage(entry)) {\n const paintEvent = handlerData.ImagePainting.paintImageForEvent.get(entry);\n return paintEvent ? getNonResolvedURL(paintEvent, handlerData) : null;\n }\n\n // DrawLazyPixelRef events use the URL from the relevant PaintImage event.\n if (Types.Events.isDrawLazyPixelRef(entry) && entry.args?.LazyPixelRef) {\n const paintEvent = handlerData.ImagePainting.paintImageByDrawLazyPixelRef.get(entry.args.LazyPixelRef);\n return paintEvent ? getNonResolvedURL(paintEvent, handlerData) : null;\n }\n }\n\n // For all other events, try to see if the URL is provided, else return null.\n if (data && typeof data.url === 'string' && data.url) {\n return data.url as Platform.DevToolsPath.UrlString;\n }\n\n // Many events don't have a url, but are associated with a request. Use the\n // request's url.\n const requestId = data && typeof data.requestId === 'string' ? data.requestId : undefined;\n if (handlerData && requestId) {\n const url = handlerData.NetworkRequests.byId.get(requestId)?.args.data.url;\n if (url) {\n return url as Platform.DevToolsPath.UrlString;\n }\n }\n\n return null;\n}\n\nexport function makeUpEntity(entityCache: Map<string, Entity>, url: string): Entity|undefined {\n if (url.startsWith('chrome-extension:')) {\n return makeUpChromeExtensionEntity(entityCache, url);\n }\n\n // Make up an entity only for valid http/https URLs.\n if (!url.startsWith('http')) {\n return;\n }\n\n // NOTE: Lighthouse uses a tld database to determine the root domain, but here\n // we are using third party web's database. Doesn't really work for the case of classifying\n // domains 3pweb doesn't know about, so it will just give us a guess.\n const rootDomain = ThirdPartyWeb.ThirdPartyWeb.getRootDomain(url);\n if (!rootDomain) {\n return;\n }\n\n if (entityCache.has(rootDomain)) {\n return entityCache.get(rootDomain);\n }\n\n const unrecognizedEntity = {\n name: rootDomain,\n company: rootDomain,\n category: '',\n categories: [],\n domains: [rootDomain],\n averageExecutionTime: 0,\n totalExecutionTime: 0,\n totalOccurrences: 0,\n isUnrecognized: true,\n };\n entityCache.set(rootDomain, unrecognizedEntity);\n return unrecognizedEntity;\n}\n\nfunction getChromeExtensionOrigin(url: URL): string {\n return url.protocol + '//' + url.host;\n}\n\nfunction makeUpChromeExtensionEntity(entityCache: Map<string, Entity>, url: string, extensionName?: string): Entity {\n const parsedUrl = new URL(url);\n const origin = getChromeExtensionOrigin(parsedUrl);\n const host = new URL(origin).host;\n const name = extensionName || host;\n\n const cachedEntity = entityCache.get(origin);\n if (cachedEntity) {\n return cachedEntity;\n }\n\n const chromeExtensionEntity = {\n name,\n company: name,\n category: 'Chrome Extension',\n homepage: 'https://chromewebstore.google.com/detail/' + host,\n categories: [],\n domains: [origin],\n averageExecutionTime: 0,\n totalExecutionTime: 0,\n totalOccurrences: 0,\n };\n\n entityCache.set(origin, chromeExtensionEntity);\n return chromeExtensionEntity;\n}\n\nexport function addEventToEntityMapping(event: Types.Events.Event, entityMappings: EntityMappings): void {\n // As we share the entityMappings between Network and Renderer... We can have ResourceSendRequest events passed in here\n // that were already mapped in Network. So, to avoid mapping twice, we always check that we didn't yet.\n if (entityMappings.entityByEvent.has(event)) {\n return;\n }\n\n const entity = getEntityForEvent(event, entityMappings);\n if (!entity) {\n return;\n }\n\n const mappedEvents = entityMappings.eventsByEntity.get(entity);\n if (mappedEvents) {\n mappedEvents.push(event);\n } else {\n entityMappings.eventsByEntity.set(entity, [event]);\n }\n entityMappings.entityByEvent.set(event, entity);\n}\n\n/** A slight upgrade of addEventToEntityMapping to handle the sub-events of a network request. **/\nexport function addNetworkRequestToEntityMapping(\n networkRequest: Types.Events.SyntheticNetworkRequest, entityMappings: EntityMappings,\n requestTraceEvents: TraceEventsForNetworkRequest): void {\n const entity = getEntityForEvent(networkRequest, entityMappings);\n if (!entity) {\n return;\n }\n // In addition to mapping the network request, we'll also assign this entity to its \"child\" instant events like receiveData, willSendRequest, finishLoading, etc,\n const eventsToMap = [networkRequest, ...Object.values(requestTraceEvents).flat()];\n const mappedEvents = entityMappings.eventsByEntity.get(entity);\n if (mappedEvents) {\n mappedEvents.push(...eventsToMap);\n } else {\n entityMappings.eventsByEntity.set(entity, eventsToMap);\n }\n for (const evt of eventsToMap) {\n entityMappings.entityByEvent.set(evt, entity);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/handlers/types.ts"],"names":[],"mappings":"","sourcesContent":["\n// Copyright 2022 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport type * as Types from './../types/types.js';\nimport type * as ModelHandlers from './ModelHandlers.js';\n\nexport type FinalizeOptions = Types.Configuration.ParseOptions&{\n allTraceEvents: readonly Types.Events.Event[],\n};\n\nexport interface Handler {\n reset(): void;\n handleEvent(data: object): void;\n finalize(options?: FinalizeOptions): Promise<void>;\n data(): unknown;\n deps?(): HandlerName[];\n handleUserConfig?(config: Types.Configuration.Configuration): void;\n}\n\nexport type HandlerName = keyof typeof ModelHandlers;\n\n/**\n * This type maps Handler names to the return type of their data\n * function. So, for example, if we are given an object with a key of 'foo'\n * and a value which is a TraceHandler containing a data() function that\n * returns a string, this type will be { foo: string }.\n *\n * This allows us to model the behavior of the TraceProcessor in the model,\n * which takes an object with Handlers as part of its config, and\n * which ultimately returns an object keyed off the names of the\n * Handlers, and with values that are derived from each\n * Handler's data function.\n *\n * So, concretely, we provide a Handler for calculating the #time\n * bounds of a trace called TraceBounds, whose data() function returns a\n * TraceWindow. The HandlerData, therefore, would determine that the\n * TraceProcessor would contain a key called 'TraceBounds' whose value is\n * a TraceWindow.\n **/\nexport type EnabledHandlerDataWithMeta<T extends Record<string, Handler>> = {\n // We allow the user to configure which handlers are created by passing them\n // in when constructing a model instance. However, we then ensure that the\n // Meta handler is added to that, as the Model relies on some of the data\n // from the Meta handler when creating the file. Therefore, this type\n // explicitly defines that the Meta data is present, before then extending it\n // with the index type to represent all the other handlers.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Meta: Readonly<ReturnType<typeof ModelHandlers['Meta']['data']>>,\n}&{\n // For every key in the object, look up the Handler's data function\n // and use its return type as the value for the object.\n [K in keyof T]: Readonly<ReturnType<T[K]['data']>>;\n};\n\nexport type HandlersWithMeta<T extends Record<string, Handler>> = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n Meta: typeof ModelHandlers.Meta,\n}&{\n [K in keyof T]: T[K];\n};\n\n/**\n * Represents the final data from all of the handlers. If you instantiate a\n * TraceProcessor with a subset of handlers, you should instead use\n * `EnabledHandlerDataWithMeta<>`.\n **/\nexport type HandlerData = Readonly<EnabledHandlerDataWithMeta<typeof ModelHandlers>>;\n\ntype DeepWriteable<T> = {\n -readonly[P in keyof T]: DeepWriteable<T[P]>\n};\nexport type HandlerDataMutable = DeepWriteable<HandlerData>;\n\nexport type Handlers = typeof ModelHandlers;\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
import * as Platform from '../../../core/platform/platform.js';
|
|
5
|
+
import { sortTraceEventsInPlace } from './Trace.js';
|
|
6
|
+
import { canBuildTreesFromEvents, treify } from './TreeHelpers.js';
|
|
7
|
+
export function buildTrackDataFromExtensionEntries(extensionEntries, extensionTrackData, entryToNode) {
|
|
8
|
+
const dataByTrack = new Map();
|
|
9
|
+
for (const entry of extensionEntries) {
|
|
10
|
+
// Batch data by track group. For each batch, add the data of every
|
|
11
|
+
// track in the group. In cases where no track group is provided,
|
|
12
|
+
// we use the standalone track data, but use a fixed prefix in the
|
|
13
|
+
// batch key to prevent collisions where a track group has the
|
|
14
|
+
// same name as a standalone track.
|
|
15
|
+
const key = entry.devtoolsObj.trackGroup || `track-name-${entry.devtoolsObj.track}`;
|
|
16
|
+
const batchedData = Platform.MapUtilities.getWithDefault(dataByTrack, key, () => ({
|
|
17
|
+
name: entry.devtoolsObj.trackGroup || entry.devtoolsObj.track,
|
|
18
|
+
isTrackGroup: Boolean(entry.devtoolsObj.trackGroup),
|
|
19
|
+
entriesByTrack: { [entry.devtoolsObj.track]: [] },
|
|
20
|
+
}));
|
|
21
|
+
if (!batchedData.entriesByTrack[entry.devtoolsObj.track]) {
|
|
22
|
+
batchedData.entriesByTrack[entry.devtoolsObj.track] = [];
|
|
23
|
+
}
|
|
24
|
+
const entriesInTrack = batchedData.entriesByTrack[entry.devtoolsObj.track];
|
|
25
|
+
entriesInTrack.push(entry);
|
|
26
|
+
}
|
|
27
|
+
// Calculate self time if possible for track entries, on a track
|
|
28
|
+
// by track basis.
|
|
29
|
+
for (const trackData of dataByTrack.values()) {
|
|
30
|
+
for (const entries of Object.values(trackData.entriesByTrack)) {
|
|
31
|
+
sortTraceEventsInPlace(entries);
|
|
32
|
+
if (canBuildTreesFromEvents(entries)) {
|
|
33
|
+
for (const [entry, node] of treify(entries).entryToNode) {
|
|
34
|
+
entryToNode.set(entry, node);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
extensionTrackData.push(trackData);
|
|
39
|
+
}
|
|
40
|
+
return { extensionTrackData, entryToNode };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=Extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Extensions.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/helpers/Extensions.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,QAAQ,MAAM,oCAAoC,CAAC;AAG/D,OAAO,EAAC,sBAAsB,EAAC,MAAM,YAAY,CAAC;AAClD,OAAO,EAAC,uBAAuB,EAAuB,MAAM,EAAC,MAAM,kBAAkB,CAAC;AAEtF,MAAM,UAAU,kCAAkC,CAC9C,gBAAiE,EACjE,kBAAyD,EACzD,WAAoD;IAKtD,MAAM,WAAW,GAAG,IAAI,GAAG,EAA+C,CAAC;IAC3E,KAAK,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;QACrC,mEAAmE;QACnE,iEAAiE;QACjE,kEAAkE;QAClE,8DAA8D;QAC9D,mCAAmC;QACnC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,UAAU,IAAI,cAAc,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACpF,MAAM,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC,cAAc,CACpD,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;YACL,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,UAAU,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK;YAC7D,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC;YACnD,cAAc,EAAE,EAAC,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,EAAC;SAChD,CAAC,CAAC,CAAC;QAE1B,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;YACzD,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAC3D,CAAC;QACD,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC3E,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,gEAAgE;IAChE,kBAAkB;IAClB,KAAK,MAAM,SAAS,IAAI,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC;QAC7C,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC;YAC9D,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAChC,IAAI,uBAAuB,CAAC,OAAO,CAAC,EAAE,CAAC;gBACrC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;oBACxD,WAAW,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;gBAC/B,CAAC;YACH,CAAC;QACH,CAAC;QACD,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,EAAC,kBAAkB,EAAE,WAAW,EAAC,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Platform from '../../../core/platform/platform.js';\nimport type * as Types from '../types/types.js';\n\nimport {sortTraceEventsInPlace} from './Trace.js';\nimport {canBuildTreesFromEvents, type TraceEntryNode, treify} from './TreeHelpers.js';\n\nexport function buildTrackDataFromExtensionEntries(\n extensionEntries: Types.Extensions.SyntheticExtensionTrackEntry[],\n extensionTrackData: Types.Extensions.ExtensionTrackData[],\n entryToNode: Map<Types.Events.Event, TraceEntryNode>,\n ): {\n extensionTrackData: Types.Extensions.ExtensionTrackData[],\n entryToNode?: Map<Types.Events.Event, TraceEntryNode>,\n} {\n const dataByTrack = new Map<string, Types.Extensions.ExtensionTrackData>();\n for (const entry of extensionEntries) {\n // Batch data by track group. For each batch, add the data of every\n // track in the group. In cases where no track group is provided,\n // we use the standalone track data, but use a fixed prefix in the\n // batch key to prevent collisions where a track group has the\n // same name as a standalone track.\n const key = entry.devtoolsObj.trackGroup || `track-name-${entry.devtoolsObj.track}`;\n const batchedData = Platform.MapUtilities.getWithDefault(\n dataByTrack, key, () => ({\n name: entry.devtoolsObj.trackGroup || entry.devtoolsObj.track,\n isTrackGroup: Boolean(entry.devtoolsObj.trackGroup),\n entriesByTrack: {[entry.devtoolsObj.track]: []},\n }));\n\n if (!batchedData.entriesByTrack[entry.devtoolsObj.track]) {\n batchedData.entriesByTrack[entry.devtoolsObj.track] = [];\n }\n const entriesInTrack = batchedData.entriesByTrack[entry.devtoolsObj.track];\n entriesInTrack.push(entry);\n }\n // Calculate self time if possible for track entries, on a track\n // by track basis.\n for (const trackData of dataByTrack.values()) {\n for (const entries of Object.values(trackData.entriesByTrack)) {\n sortTraceEventsInPlace(entries);\n if (canBuildTreesFromEvents(entries)) {\n for (const [entry, node] of treify(entries).entryToNode) {\n entryToNode.set(entry, node);\n }\n }\n }\n extensionTrackData.push(trackData);\n }\n return {extensionTrackData, entryToNode};\n}\n"]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Important: we purposefully treat `potentially_blocking` as
|
|
2
|
+
// non-render-blocking here because:
|
|
3
|
+
// 1. An async script can run on the main thread at any point, including before
|
|
4
|
+
// the page is loaded
|
|
5
|
+
// 2. An async script will never block the parsing and rendering process of the
|
|
6
|
+
// browser.
|
|
7
|
+
// 3. Therefore, from a developer's point of view, there is nothing more they
|
|
8
|
+
// can do if they've put `async` on, and within the context of Insights, we
|
|
9
|
+
// shouldn't report an async script as render-blocking.
|
|
10
|
+
// In the future we may want to consider suggesting the use of `defer` over
|
|
11
|
+
// `async`, as it doesn't have this concern, but for now we'll allow `async`
|
|
12
|
+
// and not report it as an issue.
|
|
13
|
+
const NON_RENDER_BLOCKING_VALUES = new Set([
|
|
14
|
+
'non_blocking',
|
|
15
|
+
'dynamically_injected_non_blocking',
|
|
16
|
+
'potentially_blocking',
|
|
17
|
+
]);
|
|
18
|
+
export function isSyntheticNetworkRequestEventRenderBlocking(event) {
|
|
19
|
+
return !NON_RENDER_BLOCKING_VALUES.has(event.args.data.renderBlocking);
|
|
20
|
+
}
|
|
21
|
+
const HIGH_NETWORK_PRIORITIES = new Set([
|
|
22
|
+
"VeryHigh" /* Protocol.Network.ResourcePriority.VeryHigh */,
|
|
23
|
+
"High" /* Protocol.Network.ResourcePriority.High */,
|
|
24
|
+
"Medium" /* Protocol.Network.ResourcePriority.Medium */,
|
|
25
|
+
]);
|
|
26
|
+
export function isSyntheticNetworkRequestHighPriority(event) {
|
|
27
|
+
return HIGH_NETWORK_PRIORITIES.has(event.args.data.priority);
|
|
28
|
+
}
|
|
29
|
+
export const CACHEABLE_STATUS_CODES = new Set([200, 203, 206]);
|
|
30
|
+
/** @type {Set<LH.Crdp.Network.ResourceType>} */
|
|
31
|
+
export const STATIC_RESOURCE_TYPES = new Set([
|
|
32
|
+
"Font" /* Protocol.Network.ResourceType.Font */,
|
|
33
|
+
"Image" /* Protocol.Network.ResourceType.Image */,
|
|
34
|
+
"Media" /* Protocol.Network.ResourceType.Media */,
|
|
35
|
+
"Script" /* Protocol.Network.ResourceType.Script */,
|
|
36
|
+
"Stylesheet" /* Protocol.Network.ResourceType.Stylesheet */,
|
|
37
|
+
]);
|
|
38
|
+
export const NON_NETWORK_SCHEMES = [
|
|
39
|
+
'blob', // @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
|
|
40
|
+
'data', // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
|
41
|
+
'intent', // @see https://developer.chrome.com/docs/multidevice/android/intents/
|
|
42
|
+
'file', // @see https://en.wikipedia.org/wiki/File_URI_scheme
|
|
43
|
+
'filesystem', // @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystem
|
|
44
|
+
'chrome-extension',
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* Parses Cache-Control directives based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
|
|
48
|
+
* eg. 'no-cache, no-store, max-age=0, no-transform, private' will return
|
|
49
|
+
* {no-cache: true, no-store: true, max-age: 0, no-transform: true, private: true}
|
|
50
|
+
*/
|
|
51
|
+
export function parseCacheControl(header) {
|
|
52
|
+
if (!header) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const directives = header.split(',').map(directive => directive.trim());
|
|
56
|
+
const cacheControlOptions = {};
|
|
57
|
+
for (const directive of directives) {
|
|
58
|
+
const [key, value] = directive.split('=').map(part => part.trim());
|
|
59
|
+
switch (key) {
|
|
60
|
+
case 'max-age': {
|
|
61
|
+
const maxAge = parseInt(value, 10);
|
|
62
|
+
if (!isNaN(maxAge)) {
|
|
63
|
+
cacheControlOptions['max-age'] = maxAge;
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case 'no-cache':
|
|
68
|
+
cacheControlOptions['no-cache'] = true;
|
|
69
|
+
break;
|
|
70
|
+
case 'no-store':
|
|
71
|
+
cacheControlOptions['no-store'] = true;
|
|
72
|
+
break;
|
|
73
|
+
case 'must-revalidate':
|
|
74
|
+
cacheControlOptions['must-revalidate'] = true;
|
|
75
|
+
break;
|
|
76
|
+
case 'private':
|
|
77
|
+
cacheControlOptions['private'] = true;
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
// Ignore unknown directives
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return cacheControlOptions;
|
|
85
|
+
}
|
|
86
|
+
const SECURE_LOCALHOST_DOMAINS = ['localhost', '127.0.0.1'];
|
|
87
|
+
/**
|
|
88
|
+
* Is the host localhost-enough to satisfy the "secure context" definition
|
|
89
|
+
* https://github.com/GoogleChrome/lighthouse/pull/11766#discussion_r582340683
|
|
90
|
+
*/
|
|
91
|
+
export function isSyntheticNetworkRequestLocalhost(event) {
|
|
92
|
+
try {
|
|
93
|
+
const hostname = new URL(event.args.data.url).hostname;
|
|
94
|
+
// Any hostname terminating in `.localhost` is considered to be local.
|
|
95
|
+
// https://w3c.github.io/webappsec-secure-contexts/#localhost
|
|
96
|
+
// This method doesn't consider IPs that resolve to loopback, IPv6 or other loopback edgecases
|
|
97
|
+
return SECURE_LOCALHOST_DOMAINS.includes(hostname) || hostname.endsWith('.localhost');
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=Network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Network.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/helpers/Network.ts"],"names":[],"mappings":"AASA,6DAA6D;AAC7D,oCAAoC;AACpC,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAC/E,cAAc;AACd,6EAA6E;AAC7E,8EAA8E;AAC9E,0DAA0D;AAC1D,2EAA2E;AAC3E,4EAA4E;AAC5E,iCAAiC;AACjC,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAiB;IACzD,cAAc;IACd,mCAAmC;IACnC,sBAAsB;CACvB,CAAC,CAAC;AAEH,MAAM,UAAU,4CAA4C,CAAC,KAA8B;IACzF,OAAO,CAAC,0BAA0B,C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AQ,GAAG,EAAE,CAAC;YACZ,KAAK,SAAS,EAAE,CAAC;gBACf,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACnC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;oBACnB,mBAAmB,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;gBAC1C,CAAC;gBACD,MAAM;YACR,CAAC;YACD,KAAK,UAAU;gBACb,mBAAmB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;gBACvC,MAAM;YACR,KAAK,UAAU;gBACb,mBAAmB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;gBACvC,MAAM;YACR,KAAK,iBAAiB;gBACpB,mBAAmB,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;gBAC9C,MAAM;YACR,KAAK,SAAS;gBACZ,mBAAmB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;gBACtC,MAAM;YACR;gBACE,4BAA4B;gBAC5B,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,wBAAwB,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,kCAAkC,CAAC,KAA8B;IAC/E,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;QACvD,sEAAsE;QACtE,6DAA6D;QAC7D,8FAA8F;QAC9F,OAAO,wBAAwB,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACxF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as Protocol from '../../../generated/protocol.js';\nimport type * as Types from '../types/types.js';\n\ntype RenderBlocking = Types.Events.RenderBlocking;\ntype SyntheticNetworkRequest = Types.Events.SyntheticNetworkRequest;\n\n// Important: we purposefully treat `potentially_blocking` as\n// non-render-blocking here because:\n// 1. An async script can run on the main thread at any point, including before\n// the page is loaded\n// 2. An async script will never block the parsing and rendering process of the\n// browser.\n// 3. Therefore, from a developer's point of view, there is nothing more they\n// can do if they've put `async` on, and within the context of Insights, we\n// shouldn't report an async script as render-blocking.\n// In the future we may want to consider suggesting the use of `defer` over\n// `async`, as it doesn't have this concern, but for now we'll allow `async`\n// and not report it as an issue.\nconst NON_RENDER_BLOCKING_VALUES = new Set<RenderBlocking>([\n 'non_blocking',\n 'dynamically_injected_non_blocking',\n 'potentially_blocking',\n]);\n\nexport function isSyntheticNetworkRequestEventRenderBlocking(event: SyntheticNetworkRequest): boolean {\n return !NON_RENDER_BLOCKING_VALUES.has(event.args.data.renderBlocking);\n}\n\nconst HIGH_NETWORK_PRIORITIES = new Set<Protocol.Network.ResourcePriority>([\n Protocol.Network.ResourcePriority.VeryHigh,\n Protocol.Network.ResourcePriority.High,\n Protocol.Network.ResourcePriority.Medium,\n]);\n\nexport function isSyntheticNetworkRequestHighPriority(event: SyntheticNetworkRequest): boolean {\n return HIGH_NETWORK_PRIORITIES.has(event.args.data.priority);\n}\n\nexport interface CacheControl {\n 'max-age'?: number;\n 'no-cache'?: boolean;\n 'no-store'?: boolean;\n 'must-revalidate'?: boolean;\n // eslint-disable-next-line @stylistic/quote-props\n 'private'?: boolean;\n}\n\nexport const CACHEABLE_STATUS_CODES: Set<number> = new Set([200, 203, 206]);\n\n/** @type {Set<LH.Crdp.Network.ResourceType>} */\nexport const STATIC_RESOURCE_TYPES: Set<Protocol.Network.ResourceType> = new Set([\n Protocol.Network.ResourceType.Font,\n Protocol.Network.ResourceType.Image,\n Protocol.Network.ResourceType.Media,\n Protocol.Network.ResourceType.Script,\n Protocol.Network.ResourceType.Stylesheet,\n]);\n\nexport const NON_NETWORK_SCHEMES: string[] = [\n 'blob', // @see https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL\n 'data', // @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n 'intent', // @see https://developer.chrome.com/docs/multidevice/android/intents/\n 'file', // @see https://en.wikipedia.org/wiki/File_URI_scheme\n 'filesystem', // @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystem\n 'chrome-extension',\n];\n\n/**\n * Parses Cache-Control directives based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control\n * eg. 'no-cache, no-store, max-age=0, no-transform, private' will return\n * {no-cache: true, no-store: true, max-age: 0, no-transform: true, private: true}\n */\nexport function parseCacheControl(header: string|null): CacheControl|null {\n if (!header) {\n return null;\n }\n\n const directives = header.split(',').map(directive => directive.trim());\n const cacheControlOptions: CacheControl = {};\n\n for (const directive of directives) {\n const [key, value] = directive.split('=').map(part => part.trim());\n\n switch (key) {\n case 'max-age': {\n const maxAge = parseInt(value, 10);\n if (!isNaN(maxAge)) {\n cacheControlOptions['max-age'] = maxAge;\n }\n break;\n }\n case 'no-cache':\n cacheControlOptions['no-cache'] = true;\n break;\n case 'no-store':\n cacheControlOptions['no-store'] = true;\n break;\n case 'must-revalidate':\n cacheControlOptions['must-revalidate'] = true;\n break;\n case 'private':\n cacheControlOptions['private'] = true;\n break;\n default:\n // Ignore unknown directives\n break;\n }\n }\n\n return cacheControlOptions;\n}\n\nconst SECURE_LOCALHOST_DOMAINS = ['localhost', '127.0.0.1'];\n\n/**\n * Is the host localhost-enough to satisfy the \"secure context\" definition\n * https://github.com/GoogleChrome/lighthouse/pull/11766#discussion_r582340683\n */\nexport function isSyntheticNetworkRequestLocalhost(event: SyntheticNetworkRequest): boolean {\n try {\n const hostname = new URL(event.args.data.url).hostname;\n // Any hostname terminating in `.localhost` is considered to be local.\n // https://w3c.github.io/webappsec-secure-contexts/#localhost\n // This method doesn't consider IPs that resolve to loopback, IPv6 or other loopback edgecases\n return SECURE_LOCALHOST_DOMAINS.includes(hostname) || hostname.endsWith('.localhost');\n } catch {\n return false;\n }\n}\n"]}
|