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,605 +0,0 @@
|
|
|
1
|
-
// Copyright 2011 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 type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
|
|
6
|
-
import * as Protocol from '../../generated/protocol.js';
|
|
7
|
-
import * as Common from '../common/common.js';
|
|
8
|
-
import * as i18n from '../i18n/i18n.js';
|
|
9
|
-
import type * as Platform from '../platform/platform.js';
|
|
10
|
-
|
|
11
|
-
import {Events as RuntimeModelEvents, type ExecutionContext, RuntimeModel} from './RuntimeModel.js';
|
|
12
|
-
import {SDKModel} from './SDKModel.js';
|
|
13
|
-
import {Capability, type Target, Type} from './Target.js';
|
|
14
|
-
import {TargetManager} from './TargetManager.js';
|
|
15
|
-
|
|
16
|
-
const UIStrings = {
|
|
17
|
-
/**
|
|
18
|
-
* @description Service worker running status displayed in the Service Workers view in the Application panel
|
|
19
|
-
*/
|
|
20
|
-
running: 'running',
|
|
21
|
-
/**
|
|
22
|
-
* @description Service worker running status displayed in the Service Workers view in the Application panel
|
|
23
|
-
*/
|
|
24
|
-
starting: 'starting',
|
|
25
|
-
/**
|
|
26
|
-
* @description Service worker running status displayed in the Service Workers view in the Application panel
|
|
27
|
-
*/
|
|
28
|
-
stopped: 'stopped',
|
|
29
|
-
/**
|
|
30
|
-
* @description Service worker running status displayed in the Service Workers view in the Application panel
|
|
31
|
-
*/
|
|
32
|
-
stopping: 'stopping',
|
|
33
|
-
/**
|
|
34
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
35
|
-
*/
|
|
36
|
-
activated: 'activated',
|
|
37
|
-
/**
|
|
38
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
39
|
-
*/
|
|
40
|
-
activating: 'activating',
|
|
41
|
-
/**
|
|
42
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
43
|
-
*/
|
|
44
|
-
installed: 'installed',
|
|
45
|
-
/**
|
|
46
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
47
|
-
*/
|
|
48
|
-
installing: 'installing',
|
|
49
|
-
/**
|
|
50
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
51
|
-
*/
|
|
52
|
-
new: 'new',
|
|
53
|
-
/**
|
|
54
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
55
|
-
*/
|
|
56
|
-
redundant: 'redundant',
|
|
57
|
-
/**
|
|
58
|
-
* @description Service worker version status displayed in the Threads view of the Debugging side pane in the Sources panel
|
|
59
|
-
* @example {sw.js} PH1
|
|
60
|
-
* @example {117} PH2
|
|
61
|
-
* @example {activated} PH3
|
|
62
|
-
*/
|
|
63
|
-
sSS: '{PH1} #{PH2} ({PH3})',
|
|
64
|
-
} as const;
|
|
65
|
-
const str_ = i18n.i18n.registerUIStrings('core/sdk/ServiceWorkerManager.ts', UIStrings);
|
|
66
|
-
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
67
|
-
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
68
|
-
|
|
69
|
-
export class ServiceWorkerManager extends SDKModel<EventTypes> {
|
|
70
|
-
readonly #agent: ProtocolProxyApi.ServiceWorkerApi;
|
|
71
|
-
readonly #registrations = new Map<string, ServiceWorkerRegistration>();
|
|
72
|
-
#enabled = false;
|
|
73
|
-
readonly #forceUpdateSetting: Common.Settings.Setting<boolean>;
|
|
74
|
-
|
|
75
|
-
constructor(target: Target) {
|
|
76
|
-
super(target);
|
|
77
|
-
target.registerServiceWorkerDispatcher(new ServiceWorkerDispatcher(this));
|
|
78
|
-
this.#agent = target.serviceWorkerAgent();
|
|
79
|
-
void this.enable();
|
|
80
|
-
this.#forceUpdateSetting =
|
|
81
|
-
Common.Settings.Settings.instance().createSetting('service-worker-update-on-reload', false);
|
|
82
|
-
if (this.#forceUpdateSetting.get()) {
|
|
83
|
-
this.forceUpdateSettingChanged();
|
|
84
|
-
}
|
|
85
|
-
this.#forceUpdateSetting.addChangeListener(this.forceUpdateSettingChanged, this);
|
|
86
|
-
new ServiceWorkerContextNamer(target, this);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
async enable(): Promise<void> {
|
|
90
|
-
if (this.#enabled) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
this.#enabled = true;
|
|
94
|
-
await this.#agent.invoke_enable();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async disable(): Promise<void> {
|
|
98
|
-
if (!this.#enabled) {
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
this.#enabled = false;
|
|
102
|
-
this.#registrations.clear();
|
|
103
|
-
await this.#agent.invoke_enable();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
registrations(): Map<string, ServiceWorkerRegistration> {
|
|
107
|
-
return this.#registrations;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
findVersion(versionId: string): ServiceWorkerVersion|null {
|
|
111
|
-
for (const registration of this.registrations().values()) {
|
|
112
|
-
const version = registration.versions.get(versionId);
|
|
113
|
-
if (version) {
|
|
114
|
-
return version;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
deleteRegistration(registrationId: string): void {
|
|
121
|
-
const registration = this.#registrations.get(registrationId);
|
|
122
|
-
if (!registration) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (registration.isRedundant()) {
|
|
126
|
-
this.#registrations.delete(registrationId);
|
|
127
|
-
this.dispatchEventToListeners(Events.REGISTRATION_DELETED, registration);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
registration.deleting = true;
|
|
131
|
-
for (const version of registration.versions.values()) {
|
|
132
|
-
void this.stopWorker(version.id);
|
|
133
|
-
}
|
|
134
|
-
void this.unregister(registration.scopeURL);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
async updateRegistration(registrationId: string): Promise<void> {
|
|
138
|
-
const registration = this.#registrations.get(registrationId);
|
|
139
|
-
if (!registration) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
await this.#agent.invoke_updateRegistration({scopeURL: registration.scopeURL});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async deliverPushMessage(registrationId: Protocol.ServiceWorker.RegistrationID, data: string): Promise<void> {
|
|
146
|
-
const registration = this.#registrations.get(registrationId);
|
|
147
|
-
if (!registration) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const origin = Common.ParsedURL.ParsedURL.extractOrigin(registration.scopeURL);
|
|
151
|
-
await this.#agent.invoke_deliverPushMessage({origin, registrationId, data});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
async dispatchSyncEvent(registrationId: Protocol.ServiceWorker.RegistrationID, tag: string, lastChance: boolean):
|
|
155
|
-
Promise<void> {
|
|
156
|
-
const registration = this.#registrations.get(registrationId);
|
|
157
|
-
if (!registration) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const origin = Common.ParsedURL.ParsedURL.extractOrigin(registration.scopeURL);
|
|
161
|
-
await this.#agent.invoke_dispatchSyncEvent({origin, registrationId, tag, lastChance});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
async dispatchPeriodicSyncEvent(registrationId: Protocol.ServiceWorker.RegistrationID, tag: string): Promise<void> {
|
|
165
|
-
const registration = this.#registrations.get(registrationId);
|
|
166
|
-
if (!registration) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
const origin = Common.ParsedURL.ParsedURL.extractOrigin(registration.scopeURL);
|
|
170
|
-
await this.#agent.invoke_dispatchPeriodicSyncEvent({origin, registrationId, tag});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
private async unregister(scopeURL: string): Promise<void> {
|
|
174
|
-
await this.#agent.invoke_unregister({scopeURL});
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
async startWorker(scopeURL: string): Promise<void> {
|
|
178
|
-
await this.#agent.invoke_startWorker({scopeURL});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
async skipWaiting(scopeURL: string): Promise<void> {
|
|
182
|
-
await this.#agent.invoke_skipWaiting({scopeURL});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
async stopWorker(versionId: string): Promise<void> {
|
|
186
|
-
await this.#agent.invoke_stopWorker({versionId});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
workerRegistrationUpdated(registrations: Protocol.ServiceWorker.ServiceWorkerRegistration[]): void {
|
|
190
|
-
for (const payload of registrations) {
|
|
191
|
-
let registration = this.#registrations.get(payload.registrationId);
|
|
192
|
-
if (!registration) {
|
|
193
|
-
registration = new ServiceWorkerRegistration(payload);
|
|
194
|
-
this.#registrations.set(payload.registrationId, registration);
|
|
195
|
-
this.dispatchEventToListeners(Events.REGISTRATION_UPDATED, registration);
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
registration.update(payload);
|
|
199
|
-
|
|
200
|
-
if (registration.shouldBeRemoved()) {
|
|
201
|
-
this.#registrations.delete(registration.id);
|
|
202
|
-
this.dispatchEventToListeners(Events.REGISTRATION_DELETED, registration);
|
|
203
|
-
} else {
|
|
204
|
-
this.dispatchEventToListeners(Events.REGISTRATION_UPDATED, registration);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
workerVersionUpdated(versions: Protocol.ServiceWorker.ServiceWorkerVersion[]): void {
|
|
210
|
-
const registrations = new Set<ServiceWorkerRegistration>();
|
|
211
|
-
for (const payload of versions) {
|
|
212
|
-
const registration = this.#registrations.get(payload.registrationId);
|
|
213
|
-
if (!registration) {
|
|
214
|
-
continue;
|
|
215
|
-
}
|
|
216
|
-
registration.updateVersion(payload);
|
|
217
|
-
registrations.add(registration);
|
|
218
|
-
}
|
|
219
|
-
for (const registration of registrations) {
|
|
220
|
-
if (registration.shouldBeRemoved()) {
|
|
221
|
-
this.#registrations.delete(registration.id);
|
|
222
|
-
this.dispatchEventToListeners(Events.REGISTRATION_DELETED, registration);
|
|
223
|
-
} else {
|
|
224
|
-
this.dispatchEventToListeners(Events.REGISTRATION_UPDATED, registration);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
workerErrorReported(payload: Protocol.ServiceWorker.ServiceWorkerErrorMessage): void {
|
|
230
|
-
const registration = this.#registrations.get(payload.registrationId);
|
|
231
|
-
if (!registration) {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
registration.errors.push(payload);
|
|
235
|
-
this.dispatchEventToListeners(Events.REGISTRATION_ERROR_ADDED, {registration, error: payload});
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
private forceUpdateSettingChanged(): void {
|
|
239
|
-
const forceUpdateOnPageLoad = this.#forceUpdateSetting.get();
|
|
240
|
-
void this.#agent.invoke_setForceUpdateOnPageLoad({forceUpdateOnPageLoad});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export const enum Events {
|
|
245
|
-
REGISTRATION_UPDATED = 'RegistrationUpdated',
|
|
246
|
-
REGISTRATION_ERROR_ADDED = 'RegistrationErrorAdded',
|
|
247
|
-
REGISTRATION_DELETED = 'RegistrationDeleted',
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export interface RegistrationErrorAddedEvent {
|
|
251
|
-
registration: ServiceWorkerRegistration;
|
|
252
|
-
error: Protocol.ServiceWorker.ServiceWorkerErrorMessage;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export interface EventTypes {
|
|
256
|
-
[Events.REGISTRATION_UPDATED]: ServiceWorkerRegistration;
|
|
257
|
-
[Events.REGISTRATION_ERROR_ADDED]: RegistrationErrorAddedEvent;
|
|
258
|
-
[Events.REGISTRATION_DELETED]: ServiceWorkerRegistration;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
class ServiceWorkerDispatcher implements ProtocolProxyApi.ServiceWorkerDispatcher {
|
|
262
|
-
readonly #manager: ServiceWorkerManager;
|
|
263
|
-
constructor(manager: ServiceWorkerManager) {
|
|
264
|
-
this.#manager = manager;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
workerRegistrationUpdated({registrations}: Protocol.ServiceWorker.WorkerRegistrationUpdatedEvent): void {
|
|
268
|
-
this.#manager.workerRegistrationUpdated(registrations);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
workerVersionUpdated({versions}: Protocol.ServiceWorker.WorkerVersionUpdatedEvent): void {
|
|
272
|
-
this.#manager.workerVersionUpdated(versions);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
workerErrorReported({errorMessage}: Protocol.ServiceWorker.WorkerErrorReportedEvent): void {
|
|
276
|
-
this.#manager.workerErrorReported(errorMessage);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* For every version, we keep a history of ServiceWorkerVersionState. Every time
|
|
282
|
-
* a version is updated we will add a new state at the head of the history chain.
|
|
283
|
-
* This history tells us information such as what the current state is, or when
|
|
284
|
-
* the version becomes installed.
|
|
285
|
-
*/
|
|
286
|
-
export class ServiceWorkerVersionState {
|
|
287
|
-
runningStatus: Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus;
|
|
288
|
-
status: Protocol.ServiceWorker.ServiceWorkerVersionStatus;
|
|
289
|
-
lastUpdatedTimestamp: number;
|
|
290
|
-
previousState: ServiceWorkerVersionState|null;
|
|
291
|
-
constructor(
|
|
292
|
-
runningStatus: Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus,
|
|
293
|
-
status: Protocol.ServiceWorker.ServiceWorkerVersionStatus, previousState: ServiceWorkerVersionState|null,
|
|
294
|
-
timestamp: number) {
|
|
295
|
-
this.runningStatus = runningStatus;
|
|
296
|
-
this.status = status;
|
|
297
|
-
this.lastUpdatedTimestamp = timestamp;
|
|
298
|
-
this.previousState = previousState;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export class ServiceWorkerRouterRule {
|
|
303
|
-
condition: string;
|
|
304
|
-
source: string;
|
|
305
|
-
id: number;
|
|
306
|
-
constructor(condition: string, source: string, id: number) {
|
|
307
|
-
this.condition = condition;
|
|
308
|
-
this.source = source;
|
|
309
|
-
this.id = id;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
export class ServiceWorkerVersion {
|
|
314
|
-
id!: string;
|
|
315
|
-
scriptURL!: Platform.DevToolsPath.UrlString;
|
|
316
|
-
parsedURL!: Common.ParsedURL.ParsedURL;
|
|
317
|
-
securityOrigin!: string;
|
|
318
|
-
scriptLastModified!: number|undefined;
|
|
319
|
-
scriptResponseTime!: number|undefined;
|
|
320
|
-
controlledClients!: Protocol.Target.TargetID[];
|
|
321
|
-
targetId!: string|null;
|
|
322
|
-
routerRules!: ServiceWorkerRouterRule[]|null;
|
|
323
|
-
currentState!: ServiceWorkerVersionState;
|
|
324
|
-
registration: ServiceWorkerRegistration;
|
|
325
|
-
constructor(registration: ServiceWorkerRegistration, payload: Protocol.ServiceWorker.ServiceWorkerVersion) {
|
|
326
|
-
this.registration = registration;
|
|
327
|
-
this.update(payload);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
update(payload: Protocol.ServiceWorker.ServiceWorkerVersion): void {
|
|
331
|
-
this.id = payload.versionId;
|
|
332
|
-
this.scriptURL = payload.scriptURL as Platform.DevToolsPath.UrlString;
|
|
333
|
-
const parsedURL = new Common.ParsedURL.ParsedURL(payload.scriptURL);
|
|
334
|
-
this.securityOrigin = parsedURL.securityOrigin();
|
|
335
|
-
this.currentState =
|
|
336
|
-
new ServiceWorkerVersionState(payload.runningStatus, payload.status, this.currentState, Date.now());
|
|
337
|
-
this.scriptLastModified = payload.scriptLastModified;
|
|
338
|
-
this.scriptResponseTime = payload.scriptResponseTime;
|
|
339
|
-
if (payload.controlledClients) {
|
|
340
|
-
this.controlledClients = payload.controlledClients.slice();
|
|
341
|
-
} else {
|
|
342
|
-
this.controlledClients = [];
|
|
343
|
-
}
|
|
344
|
-
this.targetId = payload.targetId || null;
|
|
345
|
-
this.routerRules = null;
|
|
346
|
-
if (payload.routerRules) {
|
|
347
|
-
this.routerRules = this.parseJSONRules(payload.routerRules);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
isStartable(): boolean {
|
|
352
|
-
return !this.registration.isDeleted && this.isActivated() && this.isStopped();
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
isStoppedAndRedundant(): boolean {
|
|
356
|
-
return this.runningStatus === Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Stopped &&
|
|
357
|
-
this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.Redundant;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
isStopped(): boolean {
|
|
361
|
-
return this.runningStatus === Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Stopped;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
isStarting(): boolean {
|
|
365
|
-
return this.runningStatus === Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Starting;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
isRunning(): boolean {
|
|
369
|
-
return this.runningStatus === Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Running;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
isStopping(): boolean {
|
|
373
|
-
return this.runningStatus === Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Stopping;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
isNew(): boolean {
|
|
377
|
-
return this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.New;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
isInstalling(): boolean {
|
|
381
|
-
return this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.Installing;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
isInstalled(): boolean {
|
|
385
|
-
return this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.Installed;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
isActivating(): boolean {
|
|
389
|
-
return this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.Activating;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
isActivated(): boolean {
|
|
393
|
-
return this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.Activated;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
isRedundant(): boolean {
|
|
397
|
-
return this.status === Protocol.ServiceWorker.ServiceWorkerVersionStatus.Redundant;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
get status(): Protocol.ServiceWorker.ServiceWorkerVersionStatus {
|
|
401
|
-
return this.currentState.status;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
get runningStatus(): Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus {
|
|
405
|
-
return this.currentState.runningStatus;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
mode(): string {
|
|
409
|
-
if (this.isNew() || this.isInstalling()) {
|
|
410
|
-
return ServiceWorkerVersion.Modes.INSTALLING;
|
|
411
|
-
}
|
|
412
|
-
if (this.isInstalled()) {
|
|
413
|
-
return ServiceWorkerVersion.Modes.WAITING;
|
|
414
|
-
}
|
|
415
|
-
if (this.isActivating() || this.isActivated()) {
|
|
416
|
-
return ServiceWorkerVersion.Modes.ACTIVE;
|
|
417
|
-
}
|
|
418
|
-
return ServiceWorkerVersion.Modes.REDUNDANT;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
private parseJSONRules(input: string): ServiceWorkerRouterRule[]|null {
|
|
422
|
-
try {
|
|
423
|
-
const parsedObject = JSON.parse(input);
|
|
424
|
-
if (!Array.isArray(parsedObject)) {
|
|
425
|
-
console.error('Parse error: `routerRules` in ServiceWorkerVersion should be an array');
|
|
426
|
-
return null;
|
|
427
|
-
}
|
|
428
|
-
const routerRules: ServiceWorkerRouterRule[] = [];
|
|
429
|
-
for (const parsedRule of parsedObject) {
|
|
430
|
-
const {condition, source, id} = parsedRule;
|
|
431
|
-
if (condition === undefined || source === undefined || id === undefined) {
|
|
432
|
-
console.error('Parse error: Missing some fields of `routerRules` in ServiceWorkerVersion');
|
|
433
|
-
return null;
|
|
434
|
-
}
|
|
435
|
-
routerRules.push(new ServiceWorkerRouterRule(JSON.stringify(condition), JSON.stringify(source), id));
|
|
436
|
-
}
|
|
437
|
-
return routerRules;
|
|
438
|
-
} catch {
|
|
439
|
-
console.error('Parse error: Invalid `routerRules` in ServiceWorkerVersion');
|
|
440
|
-
return null;
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export namespace ServiceWorkerVersion {
|
|
446
|
-
export const RunningStatus = {
|
|
447
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Running]: i18nLazyString(UIStrings.running),
|
|
448
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Starting]: i18nLazyString(UIStrings.starting),
|
|
449
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Stopped]: i18nLazyString(UIStrings.stopped),
|
|
450
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionRunningStatus.Stopping]: i18nLazyString(UIStrings.stopping),
|
|
451
|
-
};
|
|
452
|
-
|
|
453
|
-
export const Status = {
|
|
454
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionStatus.Activated]: i18nLazyString(UIStrings.activated),
|
|
455
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionStatus.Activating]: i18nLazyString(UIStrings.activating),
|
|
456
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionStatus.Installed]: i18nLazyString(UIStrings.installed),
|
|
457
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionStatus.Installing]: i18nLazyString(UIStrings.installing),
|
|
458
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionStatus.New]: i18nLazyString(UIStrings.new),
|
|
459
|
-
[Protocol.ServiceWorker.ServiceWorkerVersionStatus.Redundant]: i18nLazyString(UIStrings.redundant),
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
export const enum Modes {
|
|
463
|
-
INSTALLING = 'installing',
|
|
464
|
-
WAITING = 'waiting',
|
|
465
|
-
ACTIVE = 'active',
|
|
466
|
-
REDUNDANT = 'redundant',
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
export class ServiceWorkerRegistration {
|
|
471
|
-
#fingerprint!: symbol;
|
|
472
|
-
id!: Protocol.ServiceWorker.RegistrationID;
|
|
473
|
-
scopeURL!: Platform.DevToolsPath.UrlString;
|
|
474
|
-
securityOrigin!: Platform.DevToolsPath.UrlString;
|
|
475
|
-
isDeleted!: boolean;
|
|
476
|
-
versions = new Map<string, ServiceWorkerVersion>();
|
|
477
|
-
deleting = false;
|
|
478
|
-
errors: Protocol.ServiceWorker.ServiceWorkerErrorMessage[] = [];
|
|
479
|
-
|
|
480
|
-
constructor(payload: Protocol.ServiceWorker.ServiceWorkerRegistration) {
|
|
481
|
-
this.update(payload);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
update(payload: Protocol.ServiceWorker.ServiceWorkerRegistration): void {
|
|
485
|
-
this.#fingerprint = Symbol('fingerprint');
|
|
486
|
-
this.id = payload.registrationId;
|
|
487
|
-
this.scopeURL = payload.scopeURL as Platform.DevToolsPath.UrlString;
|
|
488
|
-
const parsedURL = new Common.ParsedURL.ParsedURL(payload.scopeURL);
|
|
489
|
-
this.securityOrigin = parsedURL.securityOrigin();
|
|
490
|
-
this.isDeleted = payload.isDeleted;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
fingerprint(): symbol {
|
|
494
|
-
return this.#fingerprint;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
versionsByMode(): Map<string, ServiceWorkerVersion> {
|
|
498
|
-
const result = new Map<string, ServiceWorkerVersion>();
|
|
499
|
-
for (const version of this.versions.values()) {
|
|
500
|
-
result.set(version.mode(), version);
|
|
501
|
-
}
|
|
502
|
-
return result;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
updateVersion(payload: Protocol.ServiceWorker.ServiceWorkerVersion): ServiceWorkerVersion {
|
|
506
|
-
this.#fingerprint = Symbol('fingerprint');
|
|
507
|
-
let version = this.versions.get(payload.versionId);
|
|
508
|
-
if (!version) {
|
|
509
|
-
version = new ServiceWorkerVersion(this, payload);
|
|
510
|
-
this.versions.set(payload.versionId, version);
|
|
511
|
-
return version;
|
|
512
|
-
}
|
|
513
|
-
version.update(payload);
|
|
514
|
-
return version;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
isRedundant(): boolean {
|
|
518
|
-
for (const version of this.versions.values()) {
|
|
519
|
-
if (!version.isStoppedAndRedundant()) {
|
|
520
|
-
return false;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return true;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
shouldBeRemoved(): boolean {
|
|
527
|
-
return this.isRedundant() && (!this.errors.length || this.deleting);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
canBeRemoved(): boolean {
|
|
531
|
-
return this.isDeleted || this.deleting;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
class ServiceWorkerContextNamer {
|
|
536
|
-
readonly #target: Target;
|
|
537
|
-
readonly #serviceWorkerManager: ServiceWorkerManager;
|
|
538
|
-
readonly #versionByTargetId = new Map<string, ServiceWorkerVersion>();
|
|
539
|
-
|
|
540
|
-
constructor(target: Target, serviceWorkerManager: ServiceWorkerManager) {
|
|
541
|
-
this.#target = target;
|
|
542
|
-
this.#serviceWorkerManager = serviceWorkerManager;
|
|
543
|
-
serviceWorkerManager.addEventListener(Events.REGISTRATION_UPDATED, this.registrationsUpdated, this);
|
|
544
|
-
serviceWorkerManager.addEventListener(Events.REGISTRATION_DELETED, this.registrationsUpdated, this);
|
|
545
|
-
TargetManager.instance().addModelListener(
|
|
546
|
-
RuntimeModel, RuntimeModelEvents.ExecutionContextCreated, this.executionContextCreated, this);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
private registrationsUpdated(): void {
|
|
550
|
-
this.#versionByTargetId.clear();
|
|
551
|
-
const registrations = this.#serviceWorkerManager.registrations().values();
|
|
552
|
-
for (const registration of registrations) {
|
|
553
|
-
for (const version of registration.versions.values()) {
|
|
554
|
-
if (version.targetId) {
|
|
555
|
-
this.#versionByTargetId.set(version.targetId, version);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
this.updateAllContextLabels();
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
private executionContextCreated(event: Common.EventTarget.EventTargetEvent<ExecutionContext>): void {
|
|
563
|
-
const executionContext = event.data;
|
|
564
|
-
const serviceWorkerTargetId = this.serviceWorkerTargetId(executionContext.target());
|
|
565
|
-
if (!serviceWorkerTargetId) {
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
this.updateContextLabel(executionContext, this.#versionByTargetId.get(serviceWorkerTargetId) || null);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
private serviceWorkerTargetId(target: Target): string|null {
|
|
572
|
-
if (target.parentTarget() !== this.#target || target.type() !== Type.ServiceWorker) {
|
|
573
|
-
return null;
|
|
574
|
-
}
|
|
575
|
-
return target.id();
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
private updateAllContextLabels(): void {
|
|
579
|
-
for (const target of TargetManager.instance().targets()) {
|
|
580
|
-
const serviceWorkerTargetId = this.serviceWorkerTargetId(target);
|
|
581
|
-
if (!serviceWorkerTargetId) {
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
const version = this.#versionByTargetId.get(serviceWorkerTargetId) || null;
|
|
585
|
-
const runtimeModel = target.model(RuntimeModel);
|
|
586
|
-
const executionContexts = runtimeModel ? runtimeModel.executionContexts() : [];
|
|
587
|
-
for (const context of executionContexts) {
|
|
588
|
-
this.updateContextLabel(context, version);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
private updateContextLabel(context: ExecutionContext, version: ServiceWorkerVersion|null): void {
|
|
594
|
-
if (!version) {
|
|
595
|
-
context.setLabel('');
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
const parsedUrl = Common.ParsedURL.ParsedURL.fromString(context.origin);
|
|
599
|
-
const label = parsedUrl ? parsedUrl.lastPathComponentWithFragment() : context.name;
|
|
600
|
-
const localizedStatus = ServiceWorkerVersion.Status[version.status];
|
|
601
|
-
context.setLabel(i18nString(UIStrings.sSS, {PH1: label, PH2: version.id, PH3: localizedStatus()}));
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
SDKModel.register(ServiceWorkerManager, {capabilities: Capability.SERVICE_WORKER, autostart: true});
|