chrome-devtools-mcp 0.10.0 → 0.10.1
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/src/McpContext.js
CHANGED
|
@@ -46,7 +46,7 @@ export class McpContext {
|
|
|
46
46
|
// The most recent page state.
|
|
47
47
|
#pages = [];
|
|
48
48
|
#pageToDevToolsPage = new Map();
|
|
49
|
-
#
|
|
49
|
+
#selectedPage;
|
|
50
50
|
// The most recent snapshot.
|
|
51
51
|
#textSnapshot = null;
|
|
52
52
|
#networkCollector;
|
|
@@ -85,7 +85,6 @@ export class McpContext {
|
|
|
85
85
|
}
|
|
86
86
|
async #init() {
|
|
87
87
|
await this.createPagesSnapshot();
|
|
88
|
-
this.setSelectedPageIdx(0);
|
|
89
88
|
await this.#networkCollector.init();
|
|
90
89
|
await this.#consoleCollector.init();
|
|
91
90
|
}
|
|
@@ -146,8 +145,8 @@ export class McpContext {
|
|
|
146
145
|
}
|
|
147
146
|
async newPage() {
|
|
148
147
|
const page = await this.browser.newPage();
|
|
149
|
-
|
|
150
|
-
this.
|
|
148
|
+
await this.createPagesSnapshot();
|
|
149
|
+
this.selectPage(page);
|
|
151
150
|
this.#networkCollector.addPage(page);
|
|
152
151
|
this.#consoleCollector.addPage(page);
|
|
153
152
|
return page;
|
|
@@ -157,7 +156,6 @@ export class McpContext {
|
|
|
157
156
|
throw new Error(CLOSE_PAGE_ERROR);
|
|
158
157
|
}
|
|
159
158
|
const page = this.getPageByIdx(pageIdx);
|
|
160
|
-
this.setSelectedPageIdx(0);
|
|
161
159
|
await page.close({ runBeforeUnload: false });
|
|
162
160
|
}
|
|
163
161
|
getNetworkRequestById(reqid) {
|
|
@@ -199,7 +197,7 @@ export class McpContext {
|
|
|
199
197
|
this.#dialog = undefined;
|
|
200
198
|
}
|
|
201
199
|
getSelectedPage() {
|
|
202
|
-
const page = this.#
|
|
200
|
+
const page = this.#selectedPage;
|
|
203
201
|
if (!page) {
|
|
204
202
|
throw new Error('No page selected');
|
|
205
203
|
}
|
|
@@ -216,17 +214,18 @@ export class McpContext {
|
|
|
216
214
|
}
|
|
217
215
|
return page;
|
|
218
216
|
}
|
|
219
|
-
getSelectedPageIdx() {
|
|
220
|
-
return this.#selectedPageIdx;
|
|
221
|
-
}
|
|
222
217
|
#dialogHandler = (dialog) => {
|
|
223
218
|
this.#dialog = dialog;
|
|
224
219
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const
|
|
220
|
+
isPageSelected(page) {
|
|
221
|
+
return this.#selectedPage === page;
|
|
222
|
+
}
|
|
223
|
+
selectPage(newPage) {
|
|
224
|
+
const oldPage = this.#selectedPage;
|
|
225
|
+
if (oldPage) {
|
|
226
|
+
oldPage.off('dialog', this.#dialogHandler);
|
|
227
|
+
}
|
|
228
|
+
this.#selectedPage = newPage;
|
|
230
229
|
newPage.on('dialog', this.#dialogHandler);
|
|
231
230
|
this.#updateSelectedPageTimeouts();
|
|
232
231
|
}
|
|
@@ -278,6 +277,9 @@ export class McpContext {
|
|
|
278
277
|
return (this.#options.experimentalDevToolsDebugging ||
|
|
279
278
|
!page.url().startsWith('devtools://'));
|
|
280
279
|
});
|
|
280
|
+
if (!this.#selectedPage || this.#pages.indexOf(this.#selectedPage) === -1) {
|
|
281
|
+
this.selectPage(this.#pages[0]);
|
|
282
|
+
}
|
|
281
283
|
await this.detectOpenDevToolsWindows();
|
|
282
284
|
return this.#pages;
|
|
283
285
|
}
|
package/build/src/McpResponse.js
CHANGED
|
@@ -231,7 +231,7 @@ Call ${handleDialog.name} to handle it before continuing.`);
|
|
|
231
231
|
const parts = [`## Pages`];
|
|
232
232
|
let idx = 0;
|
|
233
233
|
for (const page of context.getPages()) {
|
|
234
|
-
parts.push(`${idx}: ${page.url()}${
|
|
234
|
+
parts.push(`${idx}: ${page.url()}${context.isPageSelected(page) ? ' [selected]' : ''}`);
|
|
235
235
|
idx++;
|
|
236
236
|
}
|
|
237
237
|
response.push(...parts);
|
package/build/src/main.js
CHANGED
|
@@ -23,7 +23,7 @@ import * as scriptTools from './tools/script.js';
|
|
|
23
23
|
import * as snapshotTools from './tools/snapshot.js';
|
|
24
24
|
// If moved update release-please config
|
|
25
25
|
// x-release-please-start-version
|
|
26
|
-
const VERSION = '0.10.
|
|
26
|
+
const VERSION = '0.10.1';
|
|
27
27
|
// x-release-please-end
|
|
28
28
|
export const args = parseArguments(VERSION);
|
|
29
29
|
const logFile = args.logFile ? saveLogsToFile(args.logFile) : undefined;
|
|
@@ -635,7 +635,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
635
635
|
|
|
636
636
|
Name: puppeteer-core
|
|
637
637
|
URL: https://github.com/puppeteer/puppeteer/tree/main/packages/puppeteer-core
|
|
638
|
-
Version: 24.29.
|
|
638
|
+
Version: 24.29.1
|
|
639
639
|
License: Apache-2.0
|
|
640
640
|
|
|
641
641
|
-------------------- DEPENDENCY DIVIDER --------------------
|
|
@@ -33676,7 +33676,7 @@ function mergeUint8Arrays(items) {
|
|
|
33676
33676
|
* Copyright 2025 Google Inc.
|
|
33677
33677
|
* SPDX-License-Identifier: Apache-2.0
|
|
33678
33678
|
*/
|
|
33679
|
-
const packageVersion = '24.29.
|
|
33679
|
+
const packageVersion = '24.29.1';
|
|
33680
33680
|
|
|
33681
33681
|
/**
|
|
33682
33682
|
* @license
|
|
@@ -42807,7 +42807,9 @@ class NetworkManager extends EventEmitter {
|
|
|
42807
42807
|
}
|
|
42808
42808
|
#canIgnoreError(error) {
|
|
42809
42809
|
return (isErrorLike$1(error) &&
|
|
42810
|
-
(isTargetClosedError(error) ||
|
|
42810
|
+
(isTargetClosedError(error) ||
|
|
42811
|
+
error.message.includes('Not supported') ||
|
|
42812
|
+
error.message.includes("wasn't found")));
|
|
42811
42813
|
}
|
|
42812
42814
|
async addClient(client) {
|
|
42813
42815
|
if (!this.#networkEnabled || this.#clients.has(client)) {
|
|
@@ -48281,8 +48283,8 @@ class Puppeteer {
|
|
|
48281
48283
|
* SPDX-License-Identifier: Apache-2.0
|
|
48282
48284
|
*/
|
|
48283
48285
|
const PUPPETEER_REVISIONS = Object.freeze({
|
|
48284
|
-
chrome: '142.0.7444.
|
|
48285
|
-
'chrome-headless-shell': '142.0.7444.
|
|
48286
|
+
chrome: '142.0.7444.61',
|
|
48287
|
+
'chrome-headless-shell': '142.0.7444.61',
|
|
48286
48288
|
firefox: 'stable_144.0.2',
|
|
48287
48289
|
});
|
|
48288
48290
|
|
package/build/src/tools/pages.js
CHANGED
|
@@ -34,7 +34,7 @@ export const selectPage = defineTool({
|
|
|
34
34
|
handler: async (request, response, context) => {
|
|
35
35
|
const page = context.getPageByIdx(request.params.pageIdx);
|
|
36
36
|
await page.bringToFront();
|
|
37
|
-
context.
|
|
37
|
+
context.selectPage(page);
|
|
38
38
|
response.setIncludePages(true);
|
|
39
39
|
},
|
|
40
40
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "MCP server for Chrome DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./build/src/index.js",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"eslint-plugin-import": "^2.32.0",
|
|
61
61
|
"globals": "^16.4.0",
|
|
62
62
|
"prettier": "^3.6.2",
|
|
63
|
-
"puppeteer": "24.29.
|
|
63
|
+
"puppeteer": "24.29.1",
|
|
64
64
|
"rollup": "4.52.5",
|
|
65
65
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
66
66
|
"rollup-plugin-license": "^3.6.0",
|