chrome-devtools-mcp 0.9.0 → 0.10.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/README.md +14 -9
- 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/ParsedURL.js +10 -20
- 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 +3 -0
- 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/host/AidaClient.js +19 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/DispatchHttpRequestClient.js +54 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/GdpClient.js +6 -51
- package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHost.js +2 -2
- 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/UserMetrics.js +14 -6
- 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/protocol_client/CDPConnection.js +17 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/InspectorBackend.js +68 -188
- package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/protocol_client.js +2 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/AnimationModel.js +1 -2
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSMatchedStyles.js +3 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSModel.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSProperty.js +3 -6
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/CSSPropertyParserMatchers.js +14 -10
- 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 +5 -33
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/Connections.js +9 -46
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/DOMModel.js +1 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/DebuggerModel.js +1 -2
- 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/NetworkManager.js +59 -37
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/NetworkRequest.js +5 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/RehydratingConnection.js +102 -4
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/SourceMap.js +2 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/core/sdk/sdk-meta.js +8 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/InspectorBackendCommands.js +1 -39
- package/build/node_modules/chrome-devtools-frontend/front_end/generated/SupportedCSSProperties.js +58 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.js +46 -45
- package/build/node_modules/chrome-devtools-frontend/front_end/models/ai_assistance/performance/AIContext.js +10 -25
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/CompilerScriptMapping.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/bindings/DebuggerWorkspaceBinding.js +1 -1
- 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/stack_trace/StackTraceModel.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/handlers/NetworkRequestsHandler.js +12 -3
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace/types/TraceEvents.js +3 -0
- package/build/node_modules/chrome-devtools-frontend/front_end/models/trace_source_maps_resolver/SourceMapsResolver.js +1 -1
- package/build/node_modules/chrome-devtools-frontend/mcp/mcp.js +14 -0
- package/build/src/DevToolsConnectionAdapter.js +1 -0
- package/build/src/DevtoolsUtils.js +44 -0
- package/build/src/McpContext.js +117 -7
- package/build/src/McpResponse.js +32 -21
- package/build/src/PageCollector.js +21 -9
- package/build/src/browser.js +8 -8
- package/build/src/cli.js +8 -3
- package/build/src/formatters/networkFormatter.js +2 -2
- package/build/src/formatters/snapshotFormatter.js +18 -6
- package/build/src/main.js +7 -2
- package/build/src/third_party/THIRD_PARTY_NOTICES +72 -52
- package/build/src/third_party/index.js +12684 -6052
- package/build/src/tools/emulation.js +37 -44
- package/build/src/tools/input.js +36 -6
- package/build/src/tools/network.js +27 -5
- package/build/src/tools/pages.js +59 -33
- package/build/src/tools/performance.js +5 -2
- package/build/src/tools/screenshot.js +2 -1
- package/build/src/tools/snapshot.js +13 -4
- package/build/src/trace-processing/parse.js +6 -16
- package/build/src/utils/keyboard.js +291 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -219,6 +219,12 @@ Go to `Settings | AI | Manage MCP Servers` -> `+ Add` to [add an MCP Server](htt
|
|
|
219
219
|
|
|
220
220
|
</details>
|
|
221
221
|
|
|
222
|
+
<details>
|
|
223
|
+
<summary>Windsurf</summary>
|
|
224
|
+
Follow the <a href="https://docs.windsurf.com/windsurf/cascade/mcp#mcp-config-json">configure MCP guide</a>
|
|
225
|
+
using the standard config from above.
|
|
226
|
+
</details>
|
|
227
|
+
|
|
222
228
|
### Your first prompt
|
|
223
229
|
|
|
224
230
|
Enter the following prompt in your MCP Client to check if everything is working:
|
|
@@ -238,25 +244,24 @@ If you run into any issues, checkout our [troubleshooting guide](./docs/troubles
|
|
|
238
244
|
|
|
239
245
|
<!-- BEGIN AUTO GENERATED TOOLS -->
|
|
240
246
|
|
|
241
|
-
- **Input automation** (
|
|
247
|
+
- **Input automation** (8 tools)
|
|
242
248
|
- [`click`](docs/tool-reference.md#click)
|
|
243
249
|
- [`drag`](docs/tool-reference.md#drag)
|
|
244
250
|
- [`fill`](docs/tool-reference.md#fill)
|
|
245
251
|
- [`fill_form`](docs/tool-reference.md#fill_form)
|
|
246
252
|
- [`handle_dialog`](docs/tool-reference.md#handle_dialog)
|
|
247
253
|
- [`hover`](docs/tool-reference.md#hover)
|
|
254
|
+
- [`press_key`](docs/tool-reference.md#press_key)
|
|
248
255
|
- [`upload_file`](docs/tool-reference.md#upload_file)
|
|
249
|
-
- **Navigation automation** (
|
|
256
|
+
- **Navigation automation** (6 tools)
|
|
250
257
|
- [`close_page`](docs/tool-reference.md#close_page)
|
|
251
258
|
- [`list_pages`](docs/tool-reference.md#list_pages)
|
|
252
259
|
- [`navigate_page`](docs/tool-reference.md#navigate_page)
|
|
253
|
-
- [`navigate_page_history`](docs/tool-reference.md#navigate_page_history)
|
|
254
260
|
- [`new_page`](docs/tool-reference.md#new_page)
|
|
255
261
|
- [`select_page`](docs/tool-reference.md#select_page)
|
|
256
262
|
- [`wait_for`](docs/tool-reference.md#wait_for)
|
|
257
|
-
- **Emulation** (
|
|
258
|
-
- [`
|
|
259
|
-
- [`emulate_network`](docs/tool-reference.md#emulate_network)
|
|
263
|
+
- **Emulation** (2 tools)
|
|
264
|
+
- [`emulate`](docs/tool-reference.md#emulate)
|
|
260
265
|
- [`resize_page`](docs/tool-reference.md#resize_page)
|
|
261
266
|
- **Performance** (3 tools)
|
|
262
267
|
- [`performance_analyze_insight`](docs/tool-reference.md#performance_analyze_insight)
|
|
@@ -332,17 +337,17 @@ The Chrome DevTools MCP server supports the following configuration option:
|
|
|
332
337
|
- **Type:** array
|
|
333
338
|
|
|
334
339
|
- **`--categoryEmulation`**
|
|
335
|
-
Set to false to
|
|
340
|
+
Set to false to exclude tools related to emulation.
|
|
336
341
|
- **Type:** boolean
|
|
337
342
|
- **Default:** `true`
|
|
338
343
|
|
|
339
344
|
- **`--categoryPerformance`**
|
|
340
|
-
Set to false to
|
|
345
|
+
Set to false to exclude tools related to performance.
|
|
341
346
|
- **Type:** boolean
|
|
342
347
|
- **Default:** `true`
|
|
343
348
|
|
|
344
349
|
- **`--categoryNetwork`**
|
|
345
|
-
Set to false to
|
|
350
|
+
Set to false to exclude tools related to network.
|
|
346
351
|
- **Type:** boolean
|
|
347
352
|
- **Default:** `true`
|
|
348
353
|
|
|
@@ -5,14 +5,7 @@ import { ObjectWrapper } from './Object.js';
|
|
|
5
5
|
import { reveal } from './Revealer.js';
|
|
6
6
|
let consoleInstance;
|
|
7
7
|
export class Console extends ObjectWrapper {
|
|
8
|
-
#messages;
|
|
9
|
-
/**
|
|
10
|
-
* Instantiable via the instance() factory below.
|
|
11
|
-
*/
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
this.#messages = [];
|
|
15
|
-
}
|
|
8
|
+
#messages = [];
|
|
16
9
|
static instance(opts) {
|
|
17
10
|
if (!consoleInstance || opts?.forceNew) {
|
|
18
11
|
consoleInstance = new Console();
|
|
@@ -44,32 +44,22 @@ export function schemeIs(url, scheme) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
export class ParsedURL {
|
|
47
|
-
isValid;
|
|
47
|
+
isValid = false;
|
|
48
48
|
url;
|
|
49
|
-
scheme;
|
|
50
|
-
user;
|
|
51
|
-
host;
|
|
52
|
-
port;
|
|
53
|
-
path;
|
|
54
|
-
queryParams;
|
|
55
|
-
fragment;
|
|
56
|
-
folderPathComponents;
|
|
57
|
-
lastPathComponent;
|
|
49
|
+
scheme = '';
|
|
50
|
+
user = '';
|
|
51
|
+
host = '';
|
|
52
|
+
port = '';
|
|
53
|
+
path = '';
|
|
54
|
+
queryParams = '';
|
|
55
|
+
fragment = '';
|
|
56
|
+
folderPathComponents = '';
|
|
57
|
+
lastPathComponent = '';
|
|
58
58
|
blobInnerScheme;
|
|
59
59
|
#displayName;
|
|
60
60
|
#dataURLDisplayName;
|
|
61
61
|
constructor(url) {
|
|
62
|
-
this.isValid = false;
|
|
63
62
|
this.url = url;
|
|
64
|
-
this.scheme = '';
|
|
65
|
-
this.user = '';
|
|
66
|
-
this.host = '';
|
|
67
|
-
this.port = '';
|
|
68
|
-
this.path = '';
|
|
69
|
-
this.queryParams = '';
|
|
70
|
-
this.fragment = '';
|
|
71
|
-
this.folderPathComponents = '';
|
|
72
|
-
this.lastPathComponent = '';
|
|
73
63
|
const isBlobUrl = this.url.startsWith('blob:');
|
|
74
64
|
const urlToMatch = isBlobUrl ? url.substring(5) : url;
|
|
75
65
|
const match = urlToMatch.match(ParsedURL.urlRegex());
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
import * as Common from '../common/common.js';
|
|
5
5
|
import * as Root from '../root/root.js';
|
|
6
|
+
import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
|
|
6
7
|
import { InspectorFrontendHostInstance } from './InspectorFrontendHost.js';
|
|
7
8
|
import { bindOutputStream } from './ResourceLoader.js';
|
|
8
9
|
export var Role;
|
|
@@ -95,6 +96,14 @@ export var Reason;
|
|
|
95
96
|
Reason[Reason["RELATED_FILE"] = 5] = "RELATED_FILE";
|
|
96
97
|
})(Reason || (Reason = {}));
|
|
97
98
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
99
|
+
export var UseCase;
|
|
100
|
+
(function (UseCase) {
|
|
101
|
+
// Unspecified usecase.
|
|
102
|
+
UseCase[UseCase["USE_CASE_UNSPECIFIED"] = 0] = "USE_CASE_UNSPECIFIED";
|
|
103
|
+
// Code generation use case is expected to generate code from scratch
|
|
104
|
+
UseCase[UseCase["CODE_GENERATION"] = 1] = "CODE_GENERATION";
|
|
105
|
+
})(UseCase || (UseCase = {}));
|
|
106
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
98
107
|
export var RecitationAction;
|
|
99
108
|
(function (RecitationAction) {
|
|
100
109
|
RecitationAction["ACTION_UNSPECIFIED"] = "ACTION_UNSPECIFIED";
|
|
@@ -129,6 +138,7 @@ const AidaLanguageToMarkdown = {
|
|
|
129
138
|
XML: 'xml',
|
|
130
139
|
};
|
|
131
140
|
export const CLIENT_NAME = 'CHROME_DEVTOOLS';
|
|
141
|
+
export const SERVICE_NAME = 'aidaService';
|
|
132
142
|
const CODE_CHUNK_SEPARATOR = (lang = '') => ('\n`````' + lang + '\n');
|
|
133
143
|
export class AidaAbortError extends Error {
|
|
134
144
|
}
|
|
@@ -358,6 +368,15 @@ export class AidaClient {
|
|
|
358
368
|
}
|
|
359
369
|
return { generatedSamples, metadata };
|
|
360
370
|
}
|
|
371
|
+
async generateCode(request) {
|
|
372
|
+
const response = await DispatchHttpRequestClient.makeHttpRequest({
|
|
373
|
+
service: SERVICE_NAME,
|
|
374
|
+
path: '/v1/aida:generateCode',
|
|
375
|
+
method: 'POST',
|
|
376
|
+
body: JSON.stringify(request),
|
|
377
|
+
});
|
|
378
|
+
return response;
|
|
379
|
+
}
|
|
361
380
|
}
|
|
362
381
|
export function convertToUserTierEnum(userTier) {
|
|
363
382
|
if (userTier) {
|
package/build/node_modules/chrome-devtools-frontend/front_end/core/host/DispatchHttpRequestClient.js
ADDED
|
@@ -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
|
+
import { InspectorFrontendHostInstance } from './InspectorFrontendHost.js';
|
|
5
|
+
export var ErrorType;
|
|
6
|
+
(function (ErrorType) {
|
|
7
|
+
ErrorType["HTTP_RESPONSE_UNAVAILABLE"] = "HTTP_RESPONSE_UNAVAILABLE";
|
|
8
|
+
ErrorType["NOT_FOUND"] = "NOT_FOUND";
|
|
9
|
+
})(ErrorType || (ErrorType = {}));
|
|
10
|
+
export class DispatchHttpRequestError extends Error {
|
|
11
|
+
type;
|
|
12
|
+
constructor(type, options) {
|
|
13
|
+
super(undefined, options);
|
|
14
|
+
this.type = type;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export async function makeHttpRequest(request) {
|
|
18
|
+
const response = await new Promise(resolve => {
|
|
19
|
+
InspectorFrontendHostInstance.dispatchHttpRequest(request, resolve);
|
|
20
|
+
});
|
|
21
|
+
debugLog({ request, response });
|
|
22
|
+
if (response.statusCode === 404) {
|
|
23
|
+
throw new DispatchHttpRequestError(ErrorType.NOT_FOUND);
|
|
24
|
+
}
|
|
25
|
+
if ('response' in response && response.statusCode === 200) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(response.response);
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
throw new DispatchHttpRequestError(ErrorType.HTTP_RESPONSE_UNAVAILABLE, { cause: err });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
throw new DispatchHttpRequestError(ErrorType.HTTP_RESPONSE_UNAVAILABLE);
|
|
34
|
+
}
|
|
35
|
+
function isDebugMode() {
|
|
36
|
+
return Boolean(localStorage.getItem('debugDispatchHttpRequestEnabled'));
|
|
37
|
+
}
|
|
38
|
+
function debugLog(...log) {
|
|
39
|
+
if (!isDebugMode()) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// eslint-disable-next-line no-console
|
|
43
|
+
console.log('debugLog', ...log);
|
|
44
|
+
}
|
|
45
|
+
function setDebugDispatchHttpRequestEnabled(enabled) {
|
|
46
|
+
if (enabled) {
|
|
47
|
+
localStorage.setItem('debugDispatchHttpRequestEnabled', 'true');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
localStorage.removeItem('debugDispatchHttpRequestEnabled');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// @ts-expect-error
|
|
54
|
+
globalThis.setDebugDispatchHttpRequestEnabled = setDebugDispatchHttpRequestEnabled;
|
|
@@ -2,7 +2,7 @@
|
|
|
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
4
|
import * as Root from '../root/root.js';
|
|
5
|
-
import
|
|
5
|
+
import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
|
|
6
6
|
export var SubscriptionStatus;
|
|
7
7
|
(function (SubscriptionStatus) {
|
|
8
8
|
SubscriptionStatus["ENABLED"] = "SUBSCRIPTION_STATE_ENABLED";
|
|
@@ -29,18 +29,6 @@ export var EmailPreference;
|
|
|
29
29
|
EmailPreference["ENABLED"] = "ENABLED";
|
|
30
30
|
EmailPreference["DISABLED"] = "DISABLED";
|
|
31
31
|
})(EmailPreference || (EmailPreference = {}));
|
|
32
|
-
export var GdpErrorType;
|
|
33
|
-
(function (GdpErrorType) {
|
|
34
|
-
GdpErrorType["HTTP_RESPONSE_UNAVAILABLE"] = "HTTP_RESPONSE_UNAVAILABLE";
|
|
35
|
-
GdpErrorType["NOT_FOUND"] = "NOT_FOUND";
|
|
36
|
-
})(GdpErrorType || (GdpErrorType = {}));
|
|
37
|
-
class GdpError extends Error {
|
|
38
|
-
type;
|
|
39
|
-
constructor(type, options) {
|
|
40
|
-
super(undefined, options);
|
|
41
|
-
this.type = type;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
32
|
/**
|
|
45
33
|
* The `batchGet` awards endpoint returns badge names with an
|
|
46
34
|
* obfuscated user ID (e.g., `profiles/12345/awards/badge-name`).
|
|
@@ -54,24 +42,10 @@ function normalizeBadgeName(name) {
|
|
|
54
42
|
export const GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK = 'https://developers.google.com/profile/u/me';
|
|
55
43
|
async function makeHttpRequest(request) {
|
|
56
44
|
if (!isGdpProfilesAvailable()) {
|
|
57
|
-
throw new
|
|
58
|
-
}
|
|
59
|
-
const response = await new Promise(resolve => {
|
|
60
|
-
InspectorFrontendHostInstance.dispatchHttpRequest(request, resolve);
|
|
61
|
-
});
|
|
62
|
-
debugLog({ request, response });
|
|
63
|
-
if (response.statusCode === 404) {
|
|
64
|
-
throw new GdpError(GdpErrorType.NOT_FOUND);
|
|
65
|
-
}
|
|
66
|
-
if ('response' in response && response.statusCode === 200) {
|
|
67
|
-
try {
|
|
68
|
-
return JSON.parse(response.response);
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
throw new GdpError(GdpErrorType.HTTP_RESPONSE_UNAVAILABLE, { cause: err });
|
|
72
|
-
}
|
|
45
|
+
throw new DispatchHttpRequestClient.DispatchHttpRequestError(DispatchHttpRequestClient.ErrorType.HTTP_RESPONSE_UNAVAILABLE);
|
|
73
46
|
}
|
|
74
|
-
|
|
47
|
+
const response = await DispatchHttpRequestClient.makeHttpRequest(request);
|
|
48
|
+
return response;
|
|
75
49
|
}
|
|
76
50
|
const SERVICE_NAME = 'gdpService';
|
|
77
51
|
let gdpClientInstance = null;
|
|
@@ -105,7 +79,8 @@ export class GdpClient {
|
|
|
105
79
|
};
|
|
106
80
|
}
|
|
107
81
|
catch (err) {
|
|
108
|
-
if (err instanceof
|
|
82
|
+
if (err instanceof DispatchHttpRequestClient.DispatchHttpRequestError &&
|
|
83
|
+
err.type === DispatchHttpRequestClient.ErrorType.HTTP_RESPONSE_UNAVAILABLE) {
|
|
109
84
|
return null;
|
|
110
85
|
}
|
|
111
86
|
}
|
|
@@ -202,24 +177,6 @@ export class GdpClient {
|
|
|
202
177
|
}
|
|
203
178
|
}
|
|
204
179
|
}
|
|
205
|
-
function isDebugMode() {
|
|
206
|
-
return Boolean(localStorage.getItem('debugGdpIntegrationEnabled'));
|
|
207
|
-
}
|
|
208
|
-
function debugLog(...log) {
|
|
209
|
-
if (!isDebugMode()) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
// eslint-disable-next-line no-console
|
|
213
|
-
console.log('debugLog', ...log);
|
|
214
|
-
}
|
|
215
|
-
function setDebugGdpIntegrationEnabled(enabled) {
|
|
216
|
-
if (enabled) {
|
|
217
|
-
localStorage.setItem('debugGdpIntegrationEnabled', 'true');
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
localStorage.removeItem('debugGdpIntegrationEnabled');
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
180
|
export function isGdpProfilesAvailable() {
|
|
224
181
|
const isBaseFeatureEnabled = Boolean(Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled);
|
|
225
182
|
const isBrandedBuild = Boolean(Root.Runtime.hostConfig.devToolsGdpProfilesAvailability?.enabled);
|
|
@@ -239,5 +196,3 @@ export function isBadgesEnabled() {
|
|
|
239
196
|
export function isStarterBadgeEnabled() {
|
|
240
197
|
return Boolean(Root.Runtime.hostConfig.devToolsGdpProfiles?.starterBadgeEnabled);
|
|
241
198
|
}
|
|
242
|
-
// @ts-expect-error
|
|
243
|
-
globalThis.setDebugGdpIntegrationEnabled = setDebugGdpIntegrationEnabled;
|
package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHost.js
CHANGED
|
@@ -140,7 +140,7 @@ export class InspectorFrontendHostStub {
|
|
|
140
140
|
fileName = url;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
/* eslint-disable-next-line
|
|
143
|
+
/* eslint-disable-next-line @devtools/no-imperative-dom-api */
|
|
144
144
|
const link = document.createElement('a');
|
|
145
145
|
link.download = fileName;
|
|
146
146
|
let blob;
|
|
@@ -439,7 +439,7 @@ class InspectorFrontendAPIImpl {
|
|
|
439
439
|
constructor() {
|
|
440
440
|
for (const descriptor of EventDescriptors) {
|
|
441
441
|
// @ts-expect-error Dispatcher magic
|
|
442
|
-
this[descriptor[
|
|
442
|
+
this[descriptor[0]] = this.dispatch.bind(this, descriptor[0], descriptor[1], descriptor[2]);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
dispatch(name, signature, _runOnceLoaded, ...params) {
|
package/build/node_modules/chrome-devtools-frontend/front_end/core/host/InspectorFrontendHostAPI.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// Copyright 2015 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
|
+
/**
|
|
5
|
+
* This values should match the one getting called from Chromium
|
|
6
|
+
*/
|
|
4
7
|
export var Events;
|
|
5
8
|
(function (Events) {
|
|
6
9
|
/* eslint-disable @typescript-eslint/naming-convention -- Accessed from web_tests */
|
|
@@ -20,7 +23,7 @@ export var Events;
|
|
|
20
23
|
Events["FileSystemsLoaded"] = "fileSystemsLoaded";
|
|
21
24
|
Events["FileSystemRemoved"] = "fileSystemRemoved";
|
|
22
25
|
Events["FileSystemAdded"] = "fileSystemAdded";
|
|
23
|
-
Events["FileSystemFilesChangedAddedRemoved"] = "
|
|
26
|
+
Events["FileSystemFilesChangedAddedRemoved"] = "fileSystemFilesChangedAddedRemoved";
|
|
24
27
|
Events["IndexingTotalWorkCalculated"] = "indexingTotalWorkCalculated";
|
|
25
28
|
Events["IndexingWorked"] = "indexingWorked";
|
|
26
29
|
Events["IndexingDone"] = "indexingDone";
|
|
@@ -35,32 +38,32 @@ export var Events;
|
|
|
35
38
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
36
39
|
})(Events || (Events = {}));
|
|
37
40
|
export const EventDescriptors = [
|
|
38
|
-
[Events.AppendedToURL,
|
|
39
|
-
[Events.CanceledSaveURL,
|
|
40
|
-
[Events.ColorThemeChanged,
|
|
41
|
-
[Events.ContextMenuCleared,
|
|
42
|
-
[Events.ContextMenuItemSelected,
|
|
43
|
-
[Events.DeviceCountUpdated,
|
|
44
|
-
[Events.DevicesDiscoveryConfigChanged,
|
|
45
|
-
[Events.DevicesPortForwardingStatusChanged,
|
|
46
|
-
[Events.DevicesUpdated,
|
|
47
|
-
[Events.DispatchMessage,
|
|
48
|
-
[Events.DispatchMessageChunk,
|
|
49
|
-
[Events.EnterInspectElementMode,
|
|
50
|
-
[Events.EyeDropperPickedColor,
|
|
51
|
-
[Events.FileSystemsLoaded,
|
|
52
|
-
[Events.FileSystemRemoved,
|
|
53
|
-
[Events.FileSystemAdded,
|
|
54
|
-
[Events.FileSystemFilesChangedAddedRemoved,
|
|
55
|
-
[Events.IndexingTotalWorkCalculated,
|
|
56
|
-
[Events.IndexingWorked,
|
|
57
|
-
[Events.IndexingDone,
|
|
58
|
-
[Events.KeyEventUnhandled,
|
|
59
|
-
[Events.ReloadInspectedPage,
|
|
60
|
-
[Events.RevealSourceLine,
|
|
61
|
-
[Events.SavedURL,
|
|
62
|
-
[Events.SearchCompleted,
|
|
63
|
-
[Events.SetInspectedTabId,
|
|
64
|
-
[Events.SetUseSoftMenu,
|
|
65
|
-
[Events.ShowPanel,
|
|
41
|
+
[Events.AppendedToURL, ['url']],
|
|
42
|
+
[Events.CanceledSaveURL, ['url']],
|
|
43
|
+
[Events.ColorThemeChanged, []],
|
|
44
|
+
[Events.ContextMenuCleared, []],
|
|
45
|
+
[Events.ContextMenuItemSelected, ['id']],
|
|
46
|
+
[Events.DeviceCountUpdated, ['count']],
|
|
47
|
+
[Events.DevicesDiscoveryConfigChanged, ['config']],
|
|
48
|
+
[Events.DevicesPortForwardingStatusChanged, ['status']],
|
|
49
|
+
[Events.DevicesUpdated, ['devices']],
|
|
50
|
+
[Events.DispatchMessage, ['messageObject']],
|
|
51
|
+
[Events.DispatchMessageChunk, ['messageChunk', 'messageSize']],
|
|
52
|
+
[Events.EnterInspectElementMode, []],
|
|
53
|
+
[Events.EyeDropperPickedColor, ['color']],
|
|
54
|
+
[Events.FileSystemsLoaded, ['fileSystems']],
|
|
55
|
+
[Events.FileSystemRemoved, ['fileSystemPath']],
|
|
56
|
+
[Events.FileSystemAdded, ['errorMessage', 'fileSystem']],
|
|
57
|
+
[Events.FileSystemFilesChangedAddedRemoved, ['changed', 'added', 'removed']],
|
|
58
|
+
[Events.IndexingTotalWorkCalculated, , ['requestId', 'fileSystemPath', 'totalWork']],
|
|
59
|
+
[Events.IndexingWorked, ['requestId', 'fileSystemPath', 'worked']],
|
|
60
|
+
[Events.IndexingDone, ['requestId', 'fileSystemPath']],
|
|
61
|
+
[Events.KeyEventUnhandled, ['event']],
|
|
62
|
+
[Events.ReloadInspectedPage, ['hard']],
|
|
63
|
+
[Events.RevealSourceLine, ['url', 'lineNumber', 'columnNumber']],
|
|
64
|
+
[Events.SavedURL, ['url', 'fileSystemPath']],
|
|
65
|
+
[Events.SearchCompleted, ['requestId', 'fileSystemPath', 'files']],
|
|
66
|
+
[Events.SetInspectedTabId, ['tabId']],
|
|
67
|
+
[Events.SetUseSoftMenu, ['useSoftMenu']],
|
|
68
|
+
[Events.ShowPanel, ['panelName']],
|
|
66
69
|
];
|
|
@@ -193,7 +193,7 @@ export class UserMetrics {
|
|
|
193
193
|
InspectorFrontendHostInstance.recordEnumeratedHistogram("DevTools.LighthouseCategoryUsed" /* EnumeratedHistogram.LighthouseCategoryUsed */, type, 6 /* LighthouseCategoryUsed.MAX_VALUE */);
|
|
194
194
|
}
|
|
195
195
|
swatchActivated(swatch) {
|
|
196
|
-
InspectorFrontendHostInstance.recordEnumeratedHistogram("DevTools.SwatchActivated" /* EnumeratedHistogram.SwatchActivated */, swatch,
|
|
196
|
+
InspectorFrontendHostInstance.recordEnumeratedHistogram("DevTools.SwatchActivated" /* EnumeratedHistogram.SwatchActivated */, swatch, 13 /* SwatchType.MAX_VALUE */);
|
|
197
197
|
}
|
|
198
198
|
animationPlaybackRateChanged(playbackRate) {
|
|
199
199
|
InspectorFrontendHostInstance.recordEnumeratedHistogram("DevTools.AnimationPlaybackRateChanged" /* EnumeratedHistogram.AnimationPlaybackRateChanged */, playbackRate, 4 /* AnimationsPlaybackRate.MAX_VALUE */);
|
|
@@ -219,6 +219,12 @@ export class UserMetrics {
|
|
|
219
219
|
performanceAIMainThreadActivityResponseSize(bytes) {
|
|
220
220
|
InspectorFrontendHostInstance.recordCountHistogram('DevTools.PerformanceAI.MainThreadActivityResponseSize', bytes, 0, 100_000, 100);
|
|
221
221
|
}
|
|
222
|
+
builtInAiAvailability(availability) {
|
|
223
|
+
InspectorFrontendHostInstance.recordEnumeratedHistogram("DevTools.BuiltInAiAvailability" /* EnumeratedHistogram.BuiltInAiAvailability */, availability, 10 /* BuiltInAiAvailability.MAX_VALUE */);
|
|
224
|
+
}
|
|
225
|
+
consoleInsightTeaserGenerated(timeInMilliseconds) {
|
|
226
|
+
InspectorFrontendHostInstance.recordPerformanceHistogram('DevTools.Insights.TeaserGenerationTime', timeInMilliseconds);
|
|
227
|
+
}
|
|
222
228
|
}
|
|
223
229
|
/**
|
|
224
230
|
* The numeric enum values are not necessarily continuous! It is possible that
|
|
@@ -417,8 +423,6 @@ export var Action;
|
|
|
417
423
|
Action[Action["AiAssistanceSideEffectConfirmed"] = 179] = "AiAssistanceSideEffectConfirmed";
|
|
418
424
|
Action[Action["AiAssistanceSideEffectRejected"] = 180] = "AiAssistanceSideEffectRejected";
|
|
419
425
|
Action[Action["AiAssistanceError"] = 181] = "AiAssistanceError";
|
|
420
|
-
Action[Action["AiAssistanceOpenedFromPerformanceInsight"] = 182] = "AiAssistanceOpenedFromPerformanceInsight";
|
|
421
|
-
Action[Action["AiAssistanceOpenedFromPerformanceFullButton"] = 183] = "AiAssistanceOpenedFromPerformanceFullButton";
|
|
422
426
|
Action[Action["AiCodeCompletionResponseServedFromCache"] = 184] = "AiCodeCompletionResponseServedFromCache";
|
|
423
427
|
Action[Action["AiCodeCompletionRequestTriggered"] = 185] = "AiCodeCompletionRequestTriggered";
|
|
424
428
|
Action[Action["AiCodeCompletionSuggestionDisplayed"] = 186] = "AiCodeCompletionSuggestionDisplayed";
|
|
@@ -426,7 +430,13 @@ export var Action;
|
|
|
426
430
|
Action[Action["AiCodeCompletionError"] = 188] = "AiCodeCompletionError";
|
|
427
431
|
Action[Action["AttributeLinkClicked"] = 189] = "AttributeLinkClicked";
|
|
428
432
|
Action[Action["InsightRequestedViaTeaser"] = 190] = "InsightRequestedViaTeaser";
|
|
429
|
-
Action[Action["
|
|
433
|
+
Action[Action["InsightTeaserGenerationStarted"] = 191] = "InsightTeaserGenerationStarted";
|
|
434
|
+
Action[Action["InsightTeaserGenerationCompleted"] = 192] = "InsightTeaserGenerationCompleted";
|
|
435
|
+
Action[Action["InsightTeaserGenerationAborted"] = 193] = "InsightTeaserGenerationAborted";
|
|
436
|
+
Action[Action["InsightTeaserGenerationErrored"] = 194] = "InsightTeaserGenerationErrored";
|
|
437
|
+
Action[Action["AiCodeGenerationSuggestionDisplayed"] = 195] = "AiCodeGenerationSuggestionDisplayed";
|
|
438
|
+
Action[Action["AiCodeGenerationSuggestionAccepted"] = 196] = "AiCodeGenerationSuggestionAccepted";
|
|
439
|
+
Action[Action["MAX_VALUE"] = 197] = "MAX_VALUE";
|
|
430
440
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
431
441
|
})(Action || (Action = {}));
|
|
432
442
|
export var PanelCodes;
|
|
@@ -702,8 +712,6 @@ export var DevtoolsExperiments;
|
|
|
702
712
|
DevtoolsExperiments[DevtoolsExperiments["just-my-code"] = 65] = "just-my-code";
|
|
703
713
|
DevtoolsExperiments[DevtoolsExperiments["use-source-map-scopes"] = 76] = "use-source-map-scopes";
|
|
704
714
|
DevtoolsExperiments[DevtoolsExperiments["timeline-show-postmessage-events"] = 86] = "timeline-show-postmessage-events";
|
|
705
|
-
DevtoolsExperiments[DevtoolsExperiments["timeline-enhanced-traces"] = 90] = "timeline-enhanced-traces";
|
|
706
|
-
DevtoolsExperiments[DevtoolsExperiments["timeline-compiled-sources"] = 91] = "timeline-compiled-sources";
|
|
707
715
|
DevtoolsExperiments[DevtoolsExperiments["timeline-debug-mode"] = 93] = "timeline-debug-mode";
|
|
708
716
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
709
717
|
// Increment this when new experiments are added.
|
|
@@ -2,11 +2,12 @@
|
|
|
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
4
|
import * as AidaClient from './AidaClient.js';
|
|
5
|
+
import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
|
|
5
6
|
import * as GdpClient from './GdpClient.js';
|
|
6
7
|
import * as InspectorFrontendHost from './InspectorFrontendHost.js';
|
|
7
8
|
import * as InspectorFrontendHostAPI from './InspectorFrontendHostAPI.js';
|
|
8
9
|
import * as Platform from './Platform.js';
|
|
9
10
|
import * as ResourceLoader from './ResourceLoader.js';
|
|
10
11
|
import * as UserMetrics from './UserMetrics.js';
|
|
11
|
-
export { AidaClient, GdpClient, InspectorFrontendHost, InspectorFrontendHostAPI, Platform, ResourceLoader, UserMetrics, };
|
|
12
|
+
export { AidaClient, DispatchHttpRequestClient, GdpClient, InspectorFrontendHost, InspectorFrontendHostAPI, Platform, ResourceLoader, UserMetrics, };
|
|
12
13
|
export const userMetrics = new UserMetrics.UserMetrics();
|
package/build/node_modules/chrome-devtools-frontend/front_end/core/protocol_client/CDPConnection.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
* Keep this in sync with https://source.chromium.org/chromium/chromium/src/+/main:third_party/inspector_protocol/crdtp/dispatch.h.
|
|
6
|
+
*/
|
|
7
|
+
export var CDPErrorStatus;
|
|
8
|
+
(function (CDPErrorStatus) {
|
|
9
|
+
CDPErrorStatus[CDPErrorStatus["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
|
|
10
|
+
CDPErrorStatus[CDPErrorStatus["INVALID_REQUEST"] = -32600] = "INVALID_REQUEST";
|
|
11
|
+
CDPErrorStatus[CDPErrorStatus["METHOD_NOT_FOUND"] = -32601] = "METHOD_NOT_FOUND";
|
|
12
|
+
CDPErrorStatus[CDPErrorStatus["INVALID_PARAMS"] = -32602] = "INVALID_PARAMS";
|
|
13
|
+
CDPErrorStatus[CDPErrorStatus["INTERNAL_ERROR"] = -32603] = "INTERNAL_ERROR";
|
|
14
|
+
CDPErrorStatus[CDPErrorStatus["SERVER_ERROR"] = -32000] = "SERVER_ERROR";
|
|
15
|
+
CDPErrorStatus[CDPErrorStatus["SESSION_NOT_FOUND"] = -32001] = "SESSION_NOT_FOUND";
|
|
16
|
+
CDPErrorStatus[CDPErrorStatus["DEVTOOLS_STUB_ERROR"] = -32015] = "DEVTOOLS_STUB_ERROR";
|
|
17
|
+
})(CDPErrorStatus || (CDPErrorStatus = {}));
|