chrome-devtools-mcp 0.22.0 → 0.23.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 +4 -0
- package/build/src/McpContext.js +0 -125
- package/build/src/McpPage.js +198 -0
- package/build/src/McpResponse.js +6 -2
- package/build/src/TextSnapshot.js +230 -0
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +10 -0
- package/build/src/bin/chrome-devtools.js +22 -14
- package/build/src/daemon/client.js +10 -10
- package/build/src/daemon/daemon.js +6 -5
- package/build/src/daemon/utils.js +19 -14
- package/build/src/third_party/THIRD_PARTY_NOTICES +27 -0
- package/build/src/third_party/bundled-packages.json +1 -0
- package/build/src/third_party/index.js +1407 -1401
- package/build/src/tools/inPage.js +2 -33
- package/build/src/tools/network.js +2 -2
- package/build/src/tools/pages.js +209 -146
- package/build/src/tools/screencast.js +19 -8
- package/build/src/version.js +1 -1
- package/package.json +2 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { zod, ajv
|
|
6
|
+
import { zod, ajv } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
8
|
import { definePageTool } from './ToolDefinition.js';
|
|
9
9
|
export const listInPageTools = definePageTool({
|
|
@@ -58,19 +58,6 @@ export const executeInPageTool = definePageTool({
|
|
|
58
58
|
throw new Error(`Failed to parse params as JSON: ${errorMessage}`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
// Creates array of ElementHandles from the UIDs in the params.
|
|
62
|
-
// We do not replace the uids with the ElementsHandles yet, because
|
|
63
|
-
// the `evaluate` function only turns them into DOM elements if they
|
|
64
|
-
// are passed as non-nested arguments.
|
|
65
|
-
const handles = [];
|
|
66
|
-
for (const value of Object.values(params)) {
|
|
67
|
-
if (value instanceof Object &&
|
|
68
|
-
'uid' in value &&
|
|
69
|
-
typeof value.uid === 'string' &&
|
|
70
|
-
Object.keys(value).length === 1) {
|
|
71
|
-
handles.push(await request.page.getElementByUid(value.uid));
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
61
|
const toolGroup = request.page.getInPageTools();
|
|
75
62
|
const tool = toolGroup?.tools.find(t => t.name === toolName);
|
|
76
63
|
if (!tool) {
|
|
@@ -82,24 +69,6 @@ export const executeInPageTool = definePageTool({
|
|
|
82
69
|
if (!valid) {
|
|
83
70
|
throw new Error(`Invalid parameters for tool ${toolName}: ${ajvInstance.errorsText(validate.errors)}`);
|
|
84
71
|
}
|
|
85
|
-
|
|
86
|
-
// Replace the UIDs with DOM elements.
|
|
87
|
-
for (const [key, value] of Object.entries(args)) {
|
|
88
|
-
if (value instanceof Object &&
|
|
89
|
-
'uid' in value &&
|
|
90
|
-
typeof value.uid === 'string' &&
|
|
91
|
-
Object.keys(value).length === 1) {
|
|
92
|
-
args[key] = elements.shift();
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (!window.__dtmcp?.executeTool) {
|
|
96
|
-
throw new Error('No tools found on the page');
|
|
97
|
-
}
|
|
98
|
-
const toolResult = await window.__dtmcp.executeTool(name, args);
|
|
99
|
-
return {
|
|
100
|
-
result: toolResult,
|
|
101
|
-
};
|
|
102
|
-
}, toolName, params, ...handles);
|
|
103
|
-
response.appendResponseLine(JSON.stringify(result, null, 2));
|
|
72
|
+
await request.page.executeInPageTool(toolName, params, response);
|
|
104
73
|
},
|
|
105
74
|
});
|
|
@@ -58,7 +58,7 @@ export const listNetworkRequests = definePageTool({
|
|
|
58
58
|
.describe('Set to true to return the preserved requests over the last 3 navigations.'),
|
|
59
59
|
},
|
|
60
60
|
handler: async (request, response, context) => {
|
|
61
|
-
const data = await
|
|
61
|
+
const data = await request.page.getDevToolsData();
|
|
62
62
|
response.attachDevToolsData(data);
|
|
63
63
|
const reqid = data?.cdpRequestId
|
|
64
64
|
? context.resolveCdpRequestId(request.page, data.cdpRequestId)
|
|
@@ -101,7 +101,7 @@ export const getNetworkRequest = definePageTool({
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
|
-
const data = await
|
|
104
|
+
const data = await request.page.getDevToolsData();
|
|
105
105
|
response.attachDevToolsData(data);
|
|
106
106
|
const reqid = data?.cdpRequestId
|
|
107
107
|
? context.resolveCdpRequestId(request.page, data.cdpRequestId)
|
package/build/src/tools/pages.js
CHANGED
|
@@ -7,6 +7,51 @@ import { logger } from '../logger.js';
|
|
|
7
7
|
import { zod } from '../third_party/index.js';
|
|
8
8
|
import { ToolCategory } from './categories.js';
|
|
9
9
|
import { CLOSE_PAGE_ERROR, definePageTool, defineTool, timeoutSchema, } from './ToolDefinition.js';
|
|
10
|
+
async function navigateWithInterception(page, action, allowListString, timeout) {
|
|
11
|
+
const allowList = allowListString
|
|
12
|
+
? allowListString.split(',').map((p) => new URLPattern(p.trim()))
|
|
13
|
+
: undefined;
|
|
14
|
+
const requestHandler = (interceptedRequest) => {
|
|
15
|
+
if (!interceptedRequest.isNavigationRequest()) {
|
|
16
|
+
void interceptedRequest.continue();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const requestUrl = interceptedRequest.url();
|
|
20
|
+
const isAllowed = allowList.some((pattern) => pattern.test(requestUrl));
|
|
21
|
+
if (isAllowed) {
|
|
22
|
+
void interceptedRequest.continue();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
logger(`Blocking request to: ${requestUrl}`);
|
|
26
|
+
void interceptedRequest.abort('blockedbyclient');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const cleanupInterception = async () => {
|
|
30
|
+
if (allowList) {
|
|
31
|
+
page.pptrPage.off('request', requestHandler);
|
|
32
|
+
await page.pptrPage.setRequestInterception(false).catch(error => {
|
|
33
|
+
logger(`Failed to disable request interception`, error);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
if (allowList) {
|
|
38
|
+
await page.pptrPage.setRequestInterception(true);
|
|
39
|
+
page.pptrPage.on('request', requestHandler);
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
await page.waitForEventsAfterAction(async () => {
|
|
43
|
+
try {
|
|
44
|
+
await action();
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
await cleanupInterception();
|
|
48
|
+
}
|
|
49
|
+
}, { timeout });
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
await cleanupInterception();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
10
55
|
export const listPages = defineTool(args => {
|
|
11
56
|
return {
|
|
12
57
|
name: 'list_pages',
|
|
@@ -78,159 +123,177 @@ export const closePage = defineTool({
|
|
|
78
123
|
response.setListInPageTools();
|
|
79
124
|
},
|
|
80
125
|
});
|
|
81
|
-
export const newPage = defineTool({
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
export const newPage = defineTool(args => {
|
|
127
|
+
return {
|
|
128
|
+
name: 'new_page',
|
|
129
|
+
description: `Open a new tab and load a URL. Use project URL if not specified otherwise.`,
|
|
130
|
+
annotations: {
|
|
131
|
+
category: ToolCategory.NAVIGATION,
|
|
132
|
+
readOnlyHint: false,
|
|
133
|
+
},
|
|
134
|
+
schema: {
|
|
135
|
+
url: zod.string().describe('URL to load in a new page.'),
|
|
136
|
+
background: zod
|
|
137
|
+
.boolean()
|
|
138
|
+
.optional()
|
|
139
|
+
.describe('Whether to open the page in the background without bringing it to the front. Default is false (foreground).'),
|
|
140
|
+
isolatedContext: zod
|
|
141
|
+
.string()
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('If specified, the page is created in an isolated browser context with the given name. ' +
|
|
144
|
+
'Pages in the same browser context share cookies and storage. ' +
|
|
145
|
+
'Pages in different browser contexts are fully isolated.'),
|
|
146
|
+
...(args?.experimentalNavigationAllowlist
|
|
147
|
+
? {
|
|
148
|
+
allowList: zod
|
|
149
|
+
.string()
|
|
150
|
+
.optional()
|
|
151
|
+
.describe('Optional comma-separated list of URL patterns to allow. If provided, all other navigations will be blocked.'),
|
|
152
|
+
}
|
|
153
|
+
: {}),
|
|
154
|
+
...timeoutSchema,
|
|
155
|
+
},
|
|
156
|
+
handler: async (request, response, context) => {
|
|
157
|
+
const page = await context.newPage(request.params.background, request.params.isolatedContext);
|
|
158
|
+
await navigateWithInterception(page, () => page.pptrPage.goto(request.params.url, {
|
|
106
159
|
timeout: request.params.timeout,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
160
|
+
}), request.params.allowList, request.params.timeout);
|
|
161
|
+
response.setIncludePages(true);
|
|
162
|
+
response.setListInPageTools();
|
|
163
|
+
},
|
|
164
|
+
};
|
|
112
165
|
});
|
|
113
|
-
export const navigatePage = definePageTool({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if (!request.params.type && !request.params.url) {
|
|
146
|
-
throw new Error('Either URL or a type is required.');
|
|
147
|
-
}
|
|
148
|
-
if (!request.params.type) {
|
|
149
|
-
request.params.type = 'url';
|
|
150
|
-
}
|
|
151
|
-
const handleBeforeUnload = request.params.handleBeforeUnload ?? 'accept';
|
|
152
|
-
const dialogHandler = (dialog) => {
|
|
153
|
-
if (dialog.type() === 'beforeunload') {
|
|
154
|
-
if (handleBeforeUnload === 'accept') {
|
|
155
|
-
response.appendResponseLine(`Accepted a beforeunload dialog.`);
|
|
156
|
-
void dialog.accept();
|
|
166
|
+
export const navigatePage = definePageTool(args => {
|
|
167
|
+
return {
|
|
168
|
+
name: 'navigate_page',
|
|
169
|
+
description: `Go to a URL, or back, forward, or reload. Use project URL if not specified otherwise.`,
|
|
170
|
+
annotations: {
|
|
171
|
+
category: ToolCategory.NAVIGATION,
|
|
172
|
+
readOnlyHint: false,
|
|
173
|
+
},
|
|
174
|
+
schema: {
|
|
175
|
+
type: zod
|
|
176
|
+
.enum(['url', 'back', 'forward', 'reload'])
|
|
177
|
+
.optional()
|
|
178
|
+
.describe('Navigate the page by URL, back or forward in history, or reload.'),
|
|
179
|
+
url: zod.string().optional().describe('Target URL (only type=url)'),
|
|
180
|
+
ignoreCache: zod
|
|
181
|
+
.boolean()
|
|
182
|
+
.optional()
|
|
183
|
+
.describe('Whether to ignore cache on reload.'),
|
|
184
|
+
handleBeforeUnload: zod
|
|
185
|
+
.enum(['accept', 'decline'])
|
|
186
|
+
.optional()
|
|
187
|
+
.describe('Whether to auto accept or beforeunload dialogs triggered by this navigation. Default is accept.'),
|
|
188
|
+
initScript: zod
|
|
189
|
+
.string()
|
|
190
|
+
.optional()
|
|
191
|
+
.describe('A JavaScript script to be executed on each new document before any other scripts for the next navigation.'),
|
|
192
|
+
...(args?.experimentalNavigationAllowlist
|
|
193
|
+
? {
|
|
194
|
+
allowList: zod
|
|
195
|
+
.string()
|
|
196
|
+
.optional()
|
|
197
|
+
.describe('Optional comma-separated list of URL patterns to allow. If provided, all other navigations will be blocked.'),
|
|
157
198
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
199
|
+
: {}),
|
|
200
|
+
...timeoutSchema,
|
|
201
|
+
},
|
|
202
|
+
handler: async (request, response) => {
|
|
203
|
+
const page = request.page;
|
|
204
|
+
const options = {
|
|
205
|
+
timeout: request.params.timeout,
|
|
206
|
+
};
|
|
207
|
+
if (!request.params.type && !request.params.url) {
|
|
208
|
+
throw new Error('Either URL or a type is required.');
|
|
209
|
+
}
|
|
210
|
+
if (!request.params.type) {
|
|
211
|
+
request.params.type = 'url';
|
|
212
|
+
}
|
|
213
|
+
const handleBeforeUnload = request.params.handleBeforeUnload ?? 'accept';
|
|
214
|
+
const dialogHandler = (dialog) => {
|
|
215
|
+
if (dialog.type() === 'beforeunload') {
|
|
216
|
+
if (handleBeforeUnload === 'accept') {
|
|
217
|
+
response.appendResponseLine(`Accepted a beforeunload dialog.`);
|
|
218
|
+
void dialog.accept();
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
response.appendResponseLine(`Declined a beforeunload dialog.`);
|
|
222
|
+
void dialog.dismiss();
|
|
223
|
+
}
|
|
224
|
+
// We are not going to report the dialog like regular dialogs.
|
|
225
|
+
page.clearDialog();
|
|
161
226
|
}
|
|
162
|
-
|
|
163
|
-
|
|
227
|
+
};
|
|
228
|
+
let initScriptId;
|
|
229
|
+
if (request.params.initScript) {
|
|
230
|
+
const { identifier } = await page.pptrPage.evaluateOnNewDocument(request.params.initScript);
|
|
231
|
+
initScriptId = identifier;
|
|
164
232
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
233
|
+
page.pptrPage.on('dialog', dialogHandler);
|
|
234
|
+
try {
|
|
235
|
+
await navigateWithInterception(page, async () => {
|
|
236
|
+
switch (request.params.type) {
|
|
237
|
+
case 'url':
|
|
238
|
+
if (!request.params.url) {
|
|
239
|
+
throw new Error('A URL is required for navigation of type=url.');
|
|
240
|
+
}
|
|
241
|
+
try {
|
|
242
|
+
await page.pptrPage.goto(request.params.url, options);
|
|
243
|
+
response.appendResponseLine(`Successfully navigated to ${request.params.url}.`);
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
response.appendResponseLine(`Unable to navigate in the selected page: ${error.message}.`);
|
|
247
|
+
}
|
|
248
|
+
break;
|
|
249
|
+
case 'back':
|
|
250
|
+
try {
|
|
251
|
+
await page.pptrPage.goBack(options);
|
|
252
|
+
response.appendResponseLine(`Successfully navigated back to ${page.pptrPage.url()}.`);
|
|
253
|
+
}
|
|
254
|
+
catch (error) {
|
|
255
|
+
response.appendResponseLine(`Unable to navigate back in the selected page: ${error.message}.`);
|
|
256
|
+
}
|
|
257
|
+
break;
|
|
258
|
+
case 'forward':
|
|
259
|
+
try {
|
|
260
|
+
await page.pptrPage.goForward(options);
|
|
261
|
+
response.appendResponseLine(`Successfully navigated forward to ${page.pptrPage.url()}.`);
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
response.appendResponseLine(`Unable to navigate forward in the selected page: ${error.message}.`);
|
|
265
|
+
}
|
|
266
|
+
break;
|
|
267
|
+
case 'reload':
|
|
268
|
+
try {
|
|
269
|
+
await page.pptrPage.reload({
|
|
270
|
+
...options,
|
|
271
|
+
ignoreCache: request.params.ignoreCache,
|
|
272
|
+
});
|
|
273
|
+
response.appendResponseLine(`Successfully reloaded the page.`);
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
response.appendResponseLine(`Unable to reload the selected page: ${error.message}.`);
|
|
277
|
+
}
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}, request.params.allowList, request.params.timeout);
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
page.pptrPage.off('dialog', dialogHandler);
|
|
284
|
+
if (initScriptId) {
|
|
285
|
+
await page.pptrPage
|
|
286
|
+
.removeScriptToEvaluateOnNewDocument(initScriptId)
|
|
287
|
+
.catch(error => {
|
|
288
|
+
logger(`Failed to remove init script`, error);
|
|
289
|
+
});
|
|
217
290
|
}
|
|
218
|
-
}, { timeout: request.params.timeout });
|
|
219
|
-
}
|
|
220
|
-
finally {
|
|
221
|
-
page.pptrPage.off('dialog', dialogHandler);
|
|
222
|
-
if (initScriptId) {
|
|
223
|
-
await page.pptrPage
|
|
224
|
-
.removeScriptToEvaluateOnNewDocument(initScriptId)
|
|
225
|
-
.catch(error => {
|
|
226
|
-
logger(`Failed to remove init script`, error);
|
|
227
|
-
});
|
|
228
291
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
292
|
+
response.setIncludePages(true);
|
|
293
|
+
response.setListInPageTools();
|
|
294
|
+
response.setListWebMcpTools();
|
|
295
|
+
},
|
|
296
|
+
};
|
|
234
297
|
});
|
|
235
298
|
export const resizePage = definePageTool({
|
|
236
299
|
name: 'resize_page',
|
|
@@ -14,33 +14,44 @@ async function generateTempFilePath() {
|
|
|
14
14
|
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'chrome-devtools-mcp-'));
|
|
15
15
|
return path.join(dir, `screencast.mp4`);
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const supportedExtensions = ['.webm', '.mp4'];
|
|
18
|
+
export const startScreencast = definePageTool(args => ({
|
|
18
19
|
name: 'screencast_start',
|
|
19
|
-
description:
|
|
20
|
+
description: `Starts recording a screencast (video) of the selected page in specified format.`,
|
|
20
21
|
annotations: {
|
|
21
22
|
category: ToolCategory.DEBUGGING,
|
|
22
23
|
readOnlyHint: false,
|
|
23
24
|
conditions: ['screencast'],
|
|
24
25
|
},
|
|
25
26
|
schema: {
|
|
26
|
-
|
|
27
|
+
filePath: zod
|
|
27
28
|
.string()
|
|
28
29
|
.optional()
|
|
29
|
-
.describe(
|
|
30
|
+
.describe(`Output file path (${supportedExtensions.join(',')} are supported). Uses mkdtemp to generate a unique path if not provided.`),
|
|
30
31
|
},
|
|
31
32
|
handler: async (request, response, context) => {
|
|
32
33
|
if (context.getScreenRecorder() !== null) {
|
|
33
34
|
response.appendResponseLine('Error: a screencast recording is already in progress. Use screencast_stop to stop it before starting a new one.');
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
|
-
const filePath = request.params.
|
|
37
|
-
|
|
37
|
+
const filePath = request.params.filePath ?? (await generateTempFilePath());
|
|
38
|
+
let enforcedExtension = '.mp4';
|
|
39
|
+
let format = 'mp4';
|
|
40
|
+
for (const supportedExtension of supportedExtensions) {
|
|
41
|
+
if (filePath.endsWith(supportedExtension)) {
|
|
42
|
+
enforcedExtension = supportedExtension;
|
|
43
|
+
format = supportedExtension.substring(1);
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const resolvedPath = ensureExtension(path.resolve(filePath), enforcedExtension);
|
|
38
48
|
const page = request.page;
|
|
39
49
|
let recorder;
|
|
40
50
|
try {
|
|
41
51
|
recorder = await page.pptrPage.screencast({
|
|
42
52
|
path: resolvedPath,
|
|
43
|
-
format:
|
|
53
|
+
format: format,
|
|
54
|
+
ffmpegPath: args?.experimentalFfmpegPath,
|
|
44
55
|
});
|
|
45
56
|
}
|
|
46
57
|
catch (err) {
|
|
@@ -54,7 +65,7 @@ export const startScreencast = definePageTool({
|
|
|
54
65
|
context.setScreenRecorder({ recorder, filePath: resolvedPath });
|
|
55
66
|
response.appendResponseLine(`Screencast recording started. The recording will be saved to ${resolvedPath}. Use ${stopScreencast.name} to stop recording.`);
|
|
56
67
|
},
|
|
57
|
-
});
|
|
68
|
+
}));
|
|
58
69
|
export const stopScreencast = definePageTool({
|
|
59
70
|
name: 'screencast_stop',
|
|
60
71
|
description: 'Stops the active screencast recording on the selected page.',
|
package/build/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "MCP server for Chrome DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"tiktoken": "^1.0.22",
|
|
81
81
|
"typescript": "^6.0.2",
|
|
82
82
|
"typescript-eslint": "^8.43.0",
|
|
83
|
+
"urlpattern-polyfill": "^10.1.0",
|
|
83
84
|
"yargs": "18.0.0"
|
|
84
85
|
},
|
|
85
86
|
"engines": {
|