chrome-devtools-mcp-for-extension 0.19.2 → 0.20.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/build/node_modules/chrome-devtools-frontend/front_end/core/common/Color.js +13 -9
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ColorConverter.js +9 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Console.js +1 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Debouncer.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Gzip.js +9 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/MapWithDefault.js +5 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ParsedURL.js +10 -20
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ResourceType.js +0 -11
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/ReturnToPanel.js +6 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Revealer.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/SegmentedRange.js +1 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Settings.js +110 -99
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/StringOutputStream.js +1 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/Throttler.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/common/common.js +1 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/AidaClient.js +21 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/DispatchHttpRequestClient.js +66 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/GdpClient.js +102 -86
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHost.js +32 -450
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHostAPI.js +32 -29
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHostStub.js +430 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/Platform.js +5 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/ResourceLoader.js +10 -22
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/UserMetrics.js +26 -15
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/host.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/ArrayUtilities.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/HostRuntime.js +19 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/StringUtilities.js +34 -32
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/api/HostRuntime.js +4 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/api/api.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/browser/HostRuntime.js +63 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/browser/browser.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/node/HostRuntime.js +72 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/node/node.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/platform/platform.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/CDPConnection.js +17 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/ConnectionTransport.js +12 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/DevToolsCDPConnection.js +138 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/InspectorBackend.js +49 -312
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/protocol_client.js +4 -9
- package/build/node_modules/chrome-devtools-frontend/front_end/core/root/DevToolsContext.js +54 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/root/root.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/AnimationModel.js +2 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CPUThrottlingManager.js +0 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSMatchedStyles.js +51 -17
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSMetadata.js +21 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSModel.js +11 -5
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSProperty.js +4 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSPropertyParser.js +11 -9
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSPropertyParserMatchers.js +34 -24
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSRule.js +52 -10
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSStartingStyle.js +21 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSStyleDeclaration.js +4 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ChildTargetManager.js +39 -35
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Connections.js +10 -47
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ConsoleModel.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Cookie.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/DOMModel.js +29 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/DebuggerModel.js +5 -20
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/EnhancedTracesParser.js +17 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/EventBreakpointsModel.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/HttpReasonPhraseStrings.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/IOModel.js +1 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/NetworkManager.js +428 -121
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/NetworkRequest.js +8 -22
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/PageResourceLoader.js +44 -34
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/PreloadingModel.js +64 -19
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/RehydratingConnection.js +139 -12
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/RemoteObject.js +5 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ResourceTreeModel.js +3 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ScopeTreeCache.js +36 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ScreenCaptureModel.js +20 -18
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Script.js +26 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/ServerSentEventsProtocol.js +3 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMap.js +54 -14
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMapCache.js +16 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMapManager.js +19 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMapScopesInfo.js +240 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Target.js +12 -17
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/TargetManager.js +38 -29
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/TraceObject.js +11 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/sdk-meta.js +80 -31
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/sdk.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/ARIAProperties.js +1301 -174
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/Deprecation.js +67 -22
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/InspectorBackendCommands.js +62 -91
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/SupportedCSSProperties.js +188 -100
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.js +30 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.js +50 -34
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js +152 -101
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AICallTree.js +11 -6
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIContext.js +25 -26
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIQueries.js +46 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/CSSWorkspaceBinding.js +10 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/CompilerScriptMapping.js +82 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/DebuggerWorkspaceBinding.js +33 -15
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/ResourceMapping.js +105 -14
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/ResourceScriptMapping.js +38 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/SASSSourceMapping.js +5 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/cpu_profile/CPUProfileDataModel.js +9 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/models/cpu_profile/ProfileTreeModel.js +6 -7
- package/build/node_modules/chrome-devtools-frontend/front_end/models/crux-manager/CrUXManager.js +6 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/formatter/FormatterWorkerPool.js +16 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/network_time_calculator/RequestTimeRanges.js +6 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/source_map_scopes/FunctionCodeResolver.js +192 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/source_map_scopes/NamesResolver.js +12 -16
- package/build/node_modules/chrome-devtools-frontend/front_end/models/source_map_scopes/source_map_scopes.js +2 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/stack_trace/StackTraceModel.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/stack_trace/Trie.js +8 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/LanternComputationData.js +1 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/ModelImpl.js +6 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/Processor.js +4 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/Styles.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/extras/TraceTree.js +11 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/FramesHandler.js +7 -5
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/LayoutShiftsHandler.js +8 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/MetaHandler.js +4 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/NetworkRequestsHandler.js +29 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/SamplesHandler.js +59 -6
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/ScriptsHandler.js +26 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/UserTimingsHandler.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/helpers.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/helpers/Timing.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/helpers/Trace.js +18 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/CLSCulprits.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/Cache.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/DOMSize.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/DocumentLatency.js +12 -11
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/DuplicatedJavaScript.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/FontDisplay.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ForcedReflow.js +3 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/INPBreakdown.js +14 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ImageDelivery.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/LCPBreakdown.js +13 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/LCPDiscovery.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/LegacyJavaScript.js +4 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ModernHTTP.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/NetworkDependencyTree.js +4 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/RenderBlocking.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/SlowCSSSelector.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/ThirdParties.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/insights/Viewport.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/types/TraceEvents.js +9 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace_source_maps_resolver/SourceMapsResolver.js +25 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/IgnoreListManager.js +41 -48
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/UISourceCode.js +38 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/WorkspaceImpl.js +5 -8
- package/build/node_modules/chrome-devtools-frontend/front_end/models/workspace/workspace-meta.js +34 -0
- package/build/src/McpContext.js +8 -1
- package/build/src/tools/bookmarks.js +0 -1
- package/build/src/tools/gemini-web.js +17 -25
- package/build/src/tools/snapshot.js +9 -2
- package/package.json +3 -3
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// Copyright 2011 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const GenericErrorCode = -32000;
|
|
9
|
-
const ConnectionClosedErrorCode = -32001;
|
|
4
|
+
import * as InspectorBackendCommands from '../../generated/InspectorBackendCommands.js';
|
|
5
|
+
import { CDPErrorStatus } from './CDPConnection.js';
|
|
6
|
+
import { ConnectionTransport } from './ConnectionTransport.js';
|
|
7
|
+
import { DevToolsCDPConnection } from './DevToolsCDPConnection.js';
|
|
10
8
|
export const splitQualifiedName = (string) => {
|
|
11
9
|
const [domain, eventName] = string.split('.');
|
|
12
10
|
return [domain, eventName];
|
|
@@ -16,10 +14,16 @@ export const qualifyName = (domain, name) => {
|
|
|
16
14
|
};
|
|
17
15
|
export class InspectorBackend {
|
|
18
16
|
agentPrototypes = new Map();
|
|
19
|
-
#initialized = false;
|
|
20
17
|
#eventParameterNamesForDomain = new Map();
|
|
21
18
|
typeMap = new Map();
|
|
22
19
|
enumMap = new Map();
|
|
20
|
+
constructor() {
|
|
21
|
+
// Create the global here because registering commands will involve putting
|
|
22
|
+
// items onto the global.
|
|
23
|
+
// @ts-expect-error Global namespace instantiation
|
|
24
|
+
globalThis.Protocol ||= {};
|
|
25
|
+
InspectorBackendCommands.registerCommands(this);
|
|
26
|
+
}
|
|
23
27
|
getOrCreateEventParameterNamesForDomain(domain) {
|
|
24
28
|
let map = this.#eventParameterNamesForDomain.get(domain);
|
|
25
29
|
if (!map) {
|
|
@@ -40,9 +44,6 @@ export class InspectorBackend {
|
|
|
40
44
|
static reportProtocolWarning(error, messageObject) {
|
|
41
45
|
console.warn(error + ': ' + JSON.stringify(messageObject));
|
|
42
46
|
}
|
|
43
|
-
isInitialized() {
|
|
44
|
-
return this.#initialized;
|
|
45
|
-
}
|
|
46
47
|
agentPrototype(domain) {
|
|
47
48
|
let prototype = this.agentPrototypes.get(domain);
|
|
48
49
|
if (!prototype) {
|
|
@@ -54,7 +55,6 @@ export class InspectorBackend {
|
|
|
54
55
|
registerCommand(method, parameters, replyArgs, description) {
|
|
55
56
|
const [domain, command] = splitQualifiedName(method);
|
|
56
57
|
this.agentPrototype(domain).registerCommand(command, parameters, replyArgs, description);
|
|
57
|
-
this.#initialized = true;
|
|
58
58
|
}
|
|
59
59
|
registerEnum(type, values) {
|
|
60
60
|
const [domain, name] = splitQualifiedName(type);
|
|
@@ -66,37 +66,14 @@ export class InspectorBackend {
|
|
|
66
66
|
// @ts-expect-error globalThis global namespace pollution
|
|
67
67
|
globalThis.Protocol[domain][name] = values;
|
|
68
68
|
this.enumMap.set(type, values);
|
|
69
|
-
this.#initialized = true;
|
|
70
69
|
}
|
|
71
70
|
registerType(method, parameters) {
|
|
72
71
|
this.typeMap.set(method, parameters);
|
|
73
|
-
this.#initialized = true;
|
|
74
72
|
}
|
|
75
73
|
registerEvent(eventName, params) {
|
|
76
74
|
const domain = eventName.split('.')[0];
|
|
77
75
|
const eventParameterNames = this.getOrCreateEventParameterNamesForDomain(domain);
|
|
78
76
|
eventParameterNames.set(eventName, params);
|
|
79
|
-
this.#initialized = true;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
let connectionFactory;
|
|
83
|
-
export class Connection {
|
|
84
|
-
// on message from browser
|
|
85
|
-
setOnMessage(_onMessage) {
|
|
86
|
-
}
|
|
87
|
-
setOnDisconnect(_onDisconnect) {
|
|
88
|
-
}
|
|
89
|
-
// send raw CDP message to browser
|
|
90
|
-
sendRawMessage(_message) {
|
|
91
|
-
}
|
|
92
|
-
disconnect() {
|
|
93
|
-
throw new Error('not implemented');
|
|
94
|
-
}
|
|
95
|
-
static setFactory(factory) {
|
|
96
|
-
connectionFactory = factory;
|
|
97
|
-
}
|
|
98
|
-
static getFactory() {
|
|
99
|
-
return connectionFactory;
|
|
100
77
|
}
|
|
101
78
|
}
|
|
102
79
|
export const test = {
|
|
@@ -128,227 +105,60 @@ export const test = {
|
|
|
128
105
|
*/
|
|
129
106
|
onMessageReceived: null,
|
|
130
107
|
};
|
|
131
|
-
const LongPollingMethods = new Set(['CSS.takeComputedStyleUpdates']);
|
|
132
108
|
export class SessionRouter {
|
|
133
109
|
#connection;
|
|
134
|
-
#lastMessageId = 1;
|
|
135
|
-
#pendingResponsesCount = 0;
|
|
136
|
-
#pendingLongPollingMessageIds = new Set();
|
|
137
110
|
#sessions = new Map();
|
|
138
|
-
#pendingScripts = [];
|
|
139
111
|
constructor(connection) {
|
|
140
112
|
this.#connection = connection;
|
|
141
|
-
|
|
142
|
-
test.sendRawMessage = this.sendRawMessageForTesting.bind(this);
|
|
143
|
-
this.#connection.setOnMessage(this.onMessage.bind(this));
|
|
144
|
-
this.#connection.setOnDisconnect(reason => {
|
|
145
|
-
const session = this.#sessions.get('');
|
|
146
|
-
if (session) {
|
|
147
|
-
session.target.dispose(reason);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
113
|
+
this.#connection.observe(this);
|
|
150
114
|
}
|
|
151
|
-
registerSession(target, sessionId
|
|
152
|
-
|
|
153
|
-
// same time, it should be tested thoroughly.
|
|
154
|
-
if (proxyConnection) {
|
|
155
|
-
for (const session of this.#sessions.values()) {
|
|
156
|
-
if (session.proxyConnection) {
|
|
157
|
-
console.error('Multiple simultaneous proxy connections are currently unsupported');
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
this.#sessions.set(sessionId, { target, callbacks: new Map(), proxyConnection });
|
|
115
|
+
registerSession(target, sessionId) {
|
|
116
|
+
this.#sessions.set(sessionId, { target });
|
|
163
117
|
}
|
|
164
118
|
unregisterSession(sessionId) {
|
|
165
119
|
const session = this.#sessions.get(sessionId);
|
|
166
120
|
if (!session) {
|
|
167
121
|
return;
|
|
168
122
|
}
|
|
169
|
-
|
|
170
|
-
|
|
123
|
+
if (this.#connection instanceof DevToolsCDPConnection) {
|
|
124
|
+
this.#connection.resolvePendingCalls(sessionId);
|
|
171
125
|
}
|
|
172
126
|
this.#sessions.delete(sessionId);
|
|
173
127
|
}
|
|
174
|
-
|
|
175
|
-
const session = this.#sessions.get(
|
|
176
|
-
if (
|
|
177
|
-
|
|
128
|
+
onDisconnect(reason) {
|
|
129
|
+
const session = this.#sessions.get('');
|
|
130
|
+
if (session) {
|
|
131
|
+
session.target.dispose(reason);
|
|
178
132
|
}
|
|
179
|
-
return session.target;
|
|
180
133
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
connection() {
|
|
185
|
-
return this.#connection;
|
|
186
|
-
}
|
|
187
|
-
sendMessage(sessionId, domain, method, params, callback) {
|
|
188
|
-
const messageId = this.nextMessageId();
|
|
189
|
-
const messageObject = {
|
|
190
|
-
id: messageId,
|
|
191
|
-
method,
|
|
192
|
-
};
|
|
193
|
-
if (params) {
|
|
194
|
-
messageObject.params = params;
|
|
195
|
-
}
|
|
196
|
-
if (sessionId) {
|
|
197
|
-
messageObject.sessionId = sessionId;
|
|
198
|
-
}
|
|
199
|
-
if (test.dumpProtocol) {
|
|
200
|
-
test.dumpProtocol('frontend: ' + JSON.stringify(messageObject));
|
|
201
|
-
}
|
|
202
|
-
if (test.onMessageSent) {
|
|
203
|
-
const paramsObject = JSON.parse(JSON.stringify(params || {}));
|
|
204
|
-
test.onMessageSent({ domain, method, params: paramsObject, id: messageId, sessionId }, this.getTargetBySessionId(sessionId));
|
|
205
|
-
}
|
|
206
|
-
++this.#pendingResponsesCount;
|
|
207
|
-
if (LongPollingMethods.has(method)) {
|
|
208
|
-
this.#pendingLongPollingMessageIds.add(messageId);
|
|
209
|
-
}
|
|
134
|
+
onEvent(event) {
|
|
135
|
+
const sessionId = event.sessionId || '';
|
|
210
136
|
const session = this.#sessions.get(sessionId);
|
|
211
|
-
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
session.callbacks.set(messageId, { callback, method });
|
|
215
|
-
this.#connection.sendRawMessage(JSON.stringify(messageObject));
|
|
137
|
+
session?.target.dispatch(event);
|
|
216
138
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
this.sendMessage(sessionId, domain, method, params, callback || (() => { }));
|
|
220
|
-
}
|
|
221
|
-
onMessage(message) {
|
|
222
|
-
if (test.dumpProtocol) {
|
|
223
|
-
test.dumpProtocol('backend: ' + ((typeof message === 'string') ? message : JSON.stringify(message)));
|
|
224
|
-
}
|
|
225
|
-
if (test.onMessageReceived) {
|
|
226
|
-
const messageObjectCopy = JSON.parse((typeof message === 'string') ? message : JSON.stringify(message));
|
|
227
|
-
test.onMessageReceived(messageObjectCopy, this.getTargetBySessionId(messageObjectCopy.sessionId));
|
|
228
|
-
}
|
|
229
|
-
const messageObject = ((typeof message === 'string') ? JSON.parse(message) : message);
|
|
230
|
-
// Send all messages to proxy connections.
|
|
231
|
-
let suppressUnknownMessageErrors = false;
|
|
232
|
-
for (const session of this.#sessions.values()) {
|
|
233
|
-
if (!session.proxyConnection) {
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
if (!session.proxyConnection.onMessage) {
|
|
237
|
-
InspectorBackend.reportProtocolError('Protocol Error: the session has a proxyConnection with no _onMessage', messageObject);
|
|
238
|
-
continue;
|
|
239
|
-
}
|
|
240
|
-
session.proxyConnection.onMessage(messageObject);
|
|
241
|
-
suppressUnknownMessageErrors = true;
|
|
242
|
-
}
|
|
243
|
-
const sessionId = messageObject.sessionId || '';
|
|
244
|
-
const session = this.#sessions.get(sessionId);
|
|
245
|
-
if (!session) {
|
|
246
|
-
if (!suppressUnknownMessageErrors) {
|
|
247
|
-
InspectorBackend.reportProtocolError('Protocol Error: the message with wrong session id', messageObject);
|
|
248
|
-
}
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
// If this message is directly for the target controlled by the proxy connection, don't handle it.
|
|
252
|
-
if (session.proxyConnection) {
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
if (session.target.getNeedsNodeJSPatching()) {
|
|
256
|
-
NodeURL.patch(messageObject);
|
|
257
|
-
}
|
|
258
|
-
if (messageObject.id !== undefined) { // just a response for some request
|
|
259
|
-
const callback = session.callbacks.get(messageObject.id);
|
|
260
|
-
session.callbacks.delete(messageObject.id);
|
|
261
|
-
if (!callback) {
|
|
262
|
-
if (messageObject.error?.code === ConnectionClosedErrorCode) {
|
|
263
|
-
// Ignore the errors that are sent as responses after the session closes.
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
if (!suppressUnknownMessageErrors) {
|
|
267
|
-
InspectorBackend.reportProtocolError('Protocol Error: the message with wrong id', messageObject);
|
|
268
|
-
}
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
callback.callback(messageObject.error || null, messageObject.result || null);
|
|
272
|
-
--this.#pendingResponsesCount;
|
|
273
|
-
this.#pendingLongPollingMessageIds.delete(messageObject.id);
|
|
274
|
-
if (this.#pendingScripts.length && !this.hasOutstandingNonLongPollingRequests()) {
|
|
275
|
-
this.deprecatedRunAfterPendingDispatches();
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
if (messageObject.method === undefined) {
|
|
280
|
-
InspectorBackend.reportProtocolError('Protocol Error: the message without method', messageObject);
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
// This cast is justified as we just checked for the presence of messageObject.method.
|
|
284
|
-
const eventMessage = messageObject;
|
|
285
|
-
session.target.dispatch(eventMessage);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
hasOutstandingNonLongPollingRequests() {
|
|
289
|
-
return this.#pendingResponsesCount - this.#pendingLongPollingMessageIds.size > 0;
|
|
290
|
-
}
|
|
291
|
-
deprecatedRunAfterPendingDispatches(script) {
|
|
292
|
-
if (script) {
|
|
293
|
-
this.#pendingScripts.push(script);
|
|
294
|
-
}
|
|
295
|
-
// Execute all promises.
|
|
296
|
-
window.setTimeout(() => {
|
|
297
|
-
if (!this.hasOutstandingNonLongPollingRequests()) {
|
|
298
|
-
this.executeAfterPendingDispatches();
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
this.deprecatedRunAfterPendingDispatches();
|
|
302
|
-
}
|
|
303
|
-
}, 0);
|
|
304
|
-
}
|
|
305
|
-
executeAfterPendingDispatches() {
|
|
306
|
-
if (!this.hasOutstandingNonLongPollingRequests()) {
|
|
307
|
-
const scripts = this.#pendingScripts;
|
|
308
|
-
this.#pendingScripts = [];
|
|
309
|
-
for (let id = 0; id < scripts.length; ++id) {
|
|
310
|
-
scripts[id]();
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
static dispatchConnectionError(callback, method) {
|
|
315
|
-
const error = {
|
|
316
|
-
message: `Connection is closed, can\'t dispatch pending call to ${method}`,
|
|
317
|
-
code: ConnectionClosedErrorCode,
|
|
318
|
-
data: null,
|
|
319
|
-
};
|
|
320
|
-
window.setTimeout(() => callback(error, null), 0);
|
|
321
|
-
}
|
|
322
|
-
static dispatchUnregisterSessionError({ callback, method }) {
|
|
323
|
-
const error = {
|
|
324
|
-
message: `Session is unregistering, can\'t dispatch pending call to ${method}`,
|
|
325
|
-
code: ConnectionClosedErrorCode,
|
|
326
|
-
data: null,
|
|
327
|
-
};
|
|
328
|
-
window.setTimeout(() => callback(error, null), 0);
|
|
139
|
+
get connection() {
|
|
140
|
+
return this.#connection;
|
|
329
141
|
}
|
|
330
142
|
}
|
|
331
143
|
export class TargetBase {
|
|
332
|
-
needsNodeJSPatching;
|
|
333
144
|
sessionId;
|
|
334
145
|
#router;
|
|
335
146
|
#agents = new Map();
|
|
336
147
|
#dispatchers = new Map();
|
|
337
|
-
constructor(
|
|
338
|
-
this.needsNodeJSPatching = needsNodeJSPatching;
|
|
148
|
+
constructor(parentTarget, sessionId, connection) {
|
|
339
149
|
this.sessionId = sessionId;
|
|
340
|
-
if (
|
|
341
|
-
throw new Error('
|
|
150
|
+
if (parentTarget && !sessionId) {
|
|
151
|
+
throw new Error('Specifying a parent target requires a session ID');
|
|
342
152
|
}
|
|
343
153
|
let router;
|
|
344
|
-
if (
|
|
154
|
+
if (parentTarget && parentTarget.#router) {
|
|
345
155
|
router = parentTarget.#router;
|
|
346
156
|
}
|
|
347
157
|
else if (connection) {
|
|
348
158
|
router = new SessionRouter(connection);
|
|
349
159
|
}
|
|
350
160
|
else {
|
|
351
|
-
router = new SessionRouter(
|
|
161
|
+
router = new SessionRouter(new DevToolsCDPConnection(ConnectionTransport.getFactory()()));
|
|
352
162
|
}
|
|
353
163
|
this.#router = router;
|
|
354
164
|
router.registerSession(this, this.sessionId);
|
|
@@ -380,9 +190,6 @@ export class TargetBase {
|
|
|
380
190
|
isDisposed() {
|
|
381
191
|
return !this.#router;
|
|
382
192
|
}
|
|
383
|
-
markAsNodeJSForTest() {
|
|
384
|
-
this.needsNodeJSPatching = true;
|
|
385
|
-
}
|
|
386
193
|
router() {
|
|
387
194
|
return this.#router;
|
|
388
195
|
}
|
|
@@ -634,10 +441,13 @@ export class TargetBase {
|
|
|
634
441
|
registerWebAuthnDispatcher(dispatcher) {
|
|
635
442
|
this.registerDispatcher('WebAuthn', dispatcher);
|
|
636
443
|
}
|
|
637
|
-
getNeedsNodeJSPatching() {
|
|
638
|
-
return this.needsNodeJSPatching;
|
|
639
|
-
}
|
|
640
444
|
}
|
|
445
|
+
/** These are not logged as console.error */
|
|
446
|
+
const IGNORED_ERRORS = new Set([
|
|
447
|
+
CDPErrorStatus.DEVTOOLS_STUB_ERROR,
|
|
448
|
+
CDPErrorStatus.SERVER_ERROR,
|
|
449
|
+
CDPErrorStatus.SESSION_NOT_FOUND,
|
|
450
|
+
]);
|
|
641
451
|
/**
|
|
642
452
|
* This is a class that serves as the prototype for a domains #agents (every target
|
|
643
453
|
* has it's own set of #agents). The InspectorBackend keeps an instance of this class
|
|
@@ -648,113 +458,40 @@ export class TargetBase {
|
|
|
648
458
|
* of the invoke_enable, etc. methods that the front-end uses.
|
|
649
459
|
*/
|
|
650
460
|
class AgentPrototype {
|
|
651
|
-
replyArgs;
|
|
652
461
|
description = '';
|
|
653
462
|
metadata;
|
|
654
463
|
domain;
|
|
655
464
|
target;
|
|
656
465
|
constructor(domain) {
|
|
657
|
-
this.replyArgs = {};
|
|
658
466
|
this.domain = domain;
|
|
659
467
|
this.metadata = {};
|
|
660
468
|
}
|
|
661
469
|
registerCommand(methodName, parameters, replyArgs, description) {
|
|
662
470
|
const domainAndMethod = qualifyName(this.domain, methodName);
|
|
663
|
-
function sendMessagePromise(...args) {
|
|
664
|
-
return AgentPrototype.prototype.sendMessageToBackendPromise.call(this, domainAndMethod, parameters, args);
|
|
665
|
-
}
|
|
666
|
-
// @ts-expect-error Method code generation
|
|
667
|
-
this[methodName] = sendMessagePromise;
|
|
668
471
|
this.metadata[domainAndMethod] = { parameters, description, replyArgs };
|
|
669
472
|
function invoke(request = {}) {
|
|
670
473
|
return this.invoke(domainAndMethod, request);
|
|
671
474
|
}
|
|
672
475
|
// @ts-expect-error Method code generation
|
|
673
476
|
this['invoke_' + methodName] = invoke;
|
|
674
|
-
this.replyArgs[domainAndMethod] = replyArgs;
|
|
675
|
-
}
|
|
676
|
-
prepareParameters(method, parameters, args, errorCallback) {
|
|
677
|
-
const params = {};
|
|
678
|
-
let hasParams = false;
|
|
679
|
-
for (const param of parameters) {
|
|
680
|
-
const paramName = param.name;
|
|
681
|
-
const typeName = param.type;
|
|
682
|
-
const optionalFlag = param.optional;
|
|
683
|
-
if (!args.length && !optionalFlag) {
|
|
684
|
-
errorCallback(`Protocol Error: Invalid number of arguments for method '${method}' call. ` +
|
|
685
|
-
`It must have the following arguments ${JSON.stringify(parameters)}'.`);
|
|
686
|
-
return null;
|
|
687
|
-
}
|
|
688
|
-
const value = args.shift();
|
|
689
|
-
if (optionalFlag && typeof value === 'undefined') {
|
|
690
|
-
continue;
|
|
691
|
-
}
|
|
692
|
-
const expectedJSType = typeName === 'array' ? 'object' : typeName;
|
|
693
|
-
if (typeof value !== expectedJSType) {
|
|
694
|
-
errorCallback(`Protocol Error: Invalid type of argument '${paramName}' for method '${method}' call. ` +
|
|
695
|
-
`It must be '${typeName}' but it is '${typeof value}'.`);
|
|
696
|
-
return null;
|
|
697
|
-
}
|
|
698
|
-
params[paramName] = value;
|
|
699
|
-
hasParams = true;
|
|
700
|
-
}
|
|
701
|
-
if (args.length) {
|
|
702
|
-
errorCallback(`Protocol Error: Extra ${args.length} arguments in a call to method '${method}'.`);
|
|
703
|
-
return null;
|
|
704
|
-
}
|
|
705
|
-
return hasParams ? params : null;
|
|
706
|
-
}
|
|
707
|
-
sendMessageToBackendPromise(method, parameters, args) {
|
|
708
|
-
let errorMessage;
|
|
709
|
-
function onError(message) {
|
|
710
|
-
console.error(message);
|
|
711
|
-
errorMessage = message;
|
|
712
|
-
}
|
|
713
|
-
const params = this.prepareParameters(method, parameters, args, onError);
|
|
714
|
-
if (errorMessage) {
|
|
715
|
-
return Promise.resolve(null);
|
|
716
|
-
}
|
|
717
|
-
return new Promise(resolve => {
|
|
718
|
-
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
719
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
720
|
-
const callback = (error, result) => {
|
|
721
|
-
if (error) {
|
|
722
|
-
if (!test.suppressRequestErrors && error.code !== DevToolsStubErrorCode && error.code !== GenericErrorCode &&
|
|
723
|
-
error.code !== ConnectionClosedErrorCode) {
|
|
724
|
-
console.error('Request ' + method + ' failed. ' + JSON.stringify(error));
|
|
725
|
-
}
|
|
726
|
-
resolve(null);
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
const args = this.replyArgs[method];
|
|
730
|
-
resolve(result && args.length ? result[args[0]] : undefined);
|
|
731
|
-
};
|
|
732
|
-
const router = this.target.router();
|
|
733
|
-
if (!router) {
|
|
734
|
-
SessionRouter.dispatchConnectionError(callback, method);
|
|
735
|
-
}
|
|
736
|
-
else {
|
|
737
|
-
router.sendMessage(this.target.sessionId, this.domain, method, params, callback);
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
477
|
}
|
|
741
478
|
invoke(method, request) {
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
479
|
+
const connection = this.target.router()?.connection;
|
|
480
|
+
if (!connection) {
|
|
481
|
+
return Promise.resolve({ result: null, getError: () => `Connection is closed, can\'t dispatch pending call to ${method}` });
|
|
482
|
+
}
|
|
483
|
+
return connection.send(method, request, this.target.sessionId)
|
|
484
|
+
.then(response => {
|
|
485
|
+
if ('error' in response && response.error) {
|
|
486
|
+
if (!test.suppressRequestErrors && !IGNORED_ERRORS.has(response.error.code)) {
|
|
487
|
+
console.error('Request ' + method + ' failed. ' + JSON.stringify(response.error));
|
|
747
488
|
}
|
|
748
|
-
|
|
749
|
-
fulfill({ ...result, getError: () => errorMessage });
|
|
750
|
-
};
|
|
751
|
-
const router = this.target.router();
|
|
752
|
-
if (!router) {
|
|
753
|
-
SessionRouter.dispatchConnectionError(callback, method);
|
|
489
|
+
return { getError: () => response.error.message };
|
|
754
490
|
}
|
|
755
|
-
|
|
756
|
-
|
|
491
|
+
if ('result' in response) {
|
|
492
|
+
return { ...response.result, getError: () => undefined };
|
|
757
493
|
}
|
|
494
|
+
return { getError: () => undefined };
|
|
758
495
|
});
|
|
759
496
|
}
|
|
760
497
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
// Copyright 2019 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
import * as
|
|
4
|
+
import * as CDPConnection from './CDPConnection.js';
|
|
5
|
+
import * as ConnectionTransport from './ConnectionTransport.js';
|
|
6
|
+
import * as DevToolsCDPConnection from './DevToolsCDPConnection.js';
|
|
5
7
|
import * as InspectorBackend from './InspectorBackend.js';
|
|
6
|
-
|
|
7
|
-
export { InspectorBackend, NodeURL, };
|
|
8
|
-
// Create the global here because registering commands will involve putting
|
|
9
|
-
// items onto the global.
|
|
10
|
-
// @ts-expect-error Global namespace instantiation
|
|
11
|
-
|
|
12
|
-
// FIXME: This instance of InspectorBackend should not be a side effect of importing this module.
|
|
13
|
-
|
|
8
|
+
export { CDPConnection, ConnectionTransport, DevToolsCDPConnection, InspectorBackend, };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright 2025 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
/**
|
|
5
|
+
* Container for singletons scoped to a single DevTools universe.
|
|
6
|
+
*
|
|
7
|
+
* When wiring up dependencies, strongly prefer to pass all direct dependencies
|
|
8
|
+
* via constructor, and not just pass a {@link DevToolsContext} around. That would hide
|
|
9
|
+
* dependencies and we want to be explicit.
|
|
10
|
+
*/
|
|
11
|
+
export class DevToolsContext {
|
|
12
|
+
#instances = new Map();
|
|
13
|
+
get(ctor) {
|
|
14
|
+
const instance = this.#instances.get(ctor);
|
|
15
|
+
if (!instance) {
|
|
16
|
+
throw new Error(`No instance for ${ctor.name}. Ensure the bootstrapper creates it.`);
|
|
17
|
+
}
|
|
18
|
+
return instance;
|
|
19
|
+
}
|
|
20
|
+
/** @deprecated Should only be used by existing `instance` accessors. */
|
|
21
|
+
has(ctor) {
|
|
22
|
+
return this.#instances.has(ctor);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Should only be used by existing `instance` accessors and the bootstrapper.
|
|
26
|
+
* Exists on the public interface only for migration purposes for now.
|
|
27
|
+
*/
|
|
28
|
+
set(ctor, instance) {
|
|
29
|
+
// TODO(crbug.com/458180550): We need to throw here if an instance was already set!
|
|
30
|
+
this.#instances.set(ctor, instance);
|
|
31
|
+
}
|
|
32
|
+
/** @deprecated Should only be used by existing `removeInstance` static methods. */
|
|
33
|
+
delete(ctor) {
|
|
34
|
+
this.#instances.delete(ctor);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
let gInstance = null;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Exists to migrate instance() methods.
|
|
40
|
+
*/
|
|
41
|
+
export function globalInstance() {
|
|
42
|
+
if (!gInstance) {
|
|
43
|
+
// TODO(crbug.com/458180550): This should really throw to prevent side-effects and globals
|
|
44
|
+
// from leaking all over the place.
|
|
45
|
+
gInstance = new DevToolsContext();
|
|
46
|
+
}
|
|
47
|
+
return gInstance;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Should only be called by test setup and MainImpl
|
|
51
|
+
*/
|
|
52
|
+
export function setGlobalInstance(context) {
|
|
53
|
+
gInstance = context;
|
|
54
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright 2020 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
+
import * as DevToolsContext from './DevToolsContext.js';
|
|
4
5
|
import * as Runtime from './Runtime.js';
|
|
5
|
-
export { Runtime };
|
|
6
|
+
export { DevToolsContext, Runtime, };
|
|
@@ -302,7 +302,7 @@ export class AnimationModel extends SDKModel {
|
|
|
302
302
|
const animation = await AnimationImpl.parsePayload(this, payload);
|
|
303
303
|
// Ignore Web Animations custom effects & groups.
|
|
304
304
|
const keyframesRule = animation.source().keyframesRule();
|
|
305
|
-
if (animation.type() === 'WebAnimation' && keyframesRule
|
|
305
|
+
if (animation.type() === 'WebAnimation' && keyframesRule?.keyframes().length === 0) {
|
|
306
306
|
this.#pendingAnimations.delete(animation.id());
|
|
307
307
|
}
|
|
308
308
|
else {
|
|
@@ -678,12 +678,11 @@ export class AnimationGroup {
|
|
|
678
678
|
#id;
|
|
679
679
|
#scrollNode;
|
|
680
680
|
#animations;
|
|
681
|
-
#paused;
|
|
681
|
+
#paused = false;
|
|
682
682
|
constructor(animationModel, id, animations) {
|
|
683
683
|
this.#animationModel = animationModel;
|
|
684
684
|
this.#id = id;
|
|
685
685
|
this.#animations = animations;
|
|
686
|
-
this.#paused = false;
|
|
687
686
|
}
|
|
688
687
|
isScrollDriven() {
|
|
689
688
|
return Boolean(this.#animations[0]?.viewOrScrollTimeline());
|
package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CPUThrottlingManager.js
CHANGED
|
@@ -148,9 +148,6 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper {
|
|
|
148
148
|
// Implemented as a requirement for being a SDKModelObserver.
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
export function throttlingManager() {
|
|
152
|
-
return CPUThrottlingManager.instance();
|
|
153
|
-
}
|
|
154
151
|
export var CPUThrottlingRates;
|
|
155
152
|
(function (CPUThrottlingRates) {
|
|
156
153
|
CPUThrottlingRates[CPUThrottlingRates["NO_THROTTLING"] = 1] = "NO_THROTTLING";
|