文件历史

提交图

23 次代码提交

作者 SHA1 备注 提交日期
Nikolay Vitkov 53483bc637 perf: use CDP to find open DevTools pages (reland) (#1210)
This should reduce the flakiness and issue with finding open DevTools
tabs for the corresponding pages.
Currently we do multiple loops over all the targets, so this should have
a nice performance improvement when multiple pages are opened.

With a fallback for older versions.
2026-03-20 11:50:27 +00:00
Wolfgang Beyer b14d03a655 revert: Reverts "perf: use CDP to find open DevTools pages." (#1201)
Reverts ChromeDevTools/chrome-devtools-mcp#1150

Quick revert because this change has broken debugging of Electron apps.
2026-03-18 10:46:24 +00:00
Nikolay Vitkov 94de19cdcd perf: use CDP to find open DevTools pages. (#1150)
This should reduce the flakiness and issue with finding open DevTools
tabs for the corresponding pages.
Currently we do multiple loops over all the targets, so this should have
a nice performance improvement when multiple pages are opened.
2026-03-11 13:30:30 +00:00
Simon Zünd 05b01ecaba feat: include Error.cause chain for uncaught errors and logged Errors (#906) 2026-02-06 11:57:33 +00:00
Simon Zünd 9b90564888 chore: implement formatting for Error.cause messages (#905)
A follow-up PR will add actual `cause` property resolving of remote
`Error` objects.
2026-02-06 11:28:40 +00:00
Simon Zünd ffa00dab1b feat: show message and stack trace in details when console.log'ging Error objects (#902)
This PR improves the `get_console_message` tool when logging `Error`
objects. We use the existing `getExceptionDetails` CDP command to
retrieve the structured stack trace, we'll then source map.

Example:

```js
try {
  compute();
} catch (e) {
  console.log('Compute failed', e);
}
```

Before:
```txt
### Arguments
Arg #0: Compute failed
Arg #1: {}
```

After:
```txt
### Arguments
Arg #0: Compute failed
Arg #1: ComputeError: Invariant violation
at compute (foo.ts:1:20)
at <anonymous> (main.ts:2:8)
Note: line and column numbers use 1-based indexing
```

---------

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2026-02-06 09:38:27 +00:00
Simon Zünd 1fad330bad chore: implement formatting of Error console.log arguments (#901)
This PR implements formatting for `SymbolizedError` objects that are
part of "resolved arguments". A follow-up PR will handle the actual
conversion of `Error` remote objects to `SymbolizedError`s.
2026-02-06 08:25:38 +00:00
Simon Zünd f4cfd4664e chore: introduce SymbolizedError class (#890)
The "SymbolizedError" class represents a fully resolved error: The stack
trace is fully resolved and (in the future), the full `Error.cause`
chain is also fully resolved.

We'll use the `SymbolizedError` for both "uncaught exceptions" as well
as when logging `Error` objects to the console (e.g. `console.log(new
Error())`. This means the `resolvedArgs` array in `ConsoleFormatter`
will contain one `SymbolizedError` instance for every `Error` object
logged.
2026-02-05 07:57:21 +00:00
Simon Zünd a08f550b28 chore: implement formatting for UncaughtError (#875) 2026-02-03 11:42:18 +00:00
Simon Zünd a3a00210a3 feat: include stack trace in 'get_console_message' tool (#740)
This is the stack trace of the console message itself. If the argument
is an Error object or an "Error.stack" like string we don't do anything
special (yet).

The stack trace is source mapped if source maps are available.

The function matches the target ID of the console message to the
`SDK.Target` of DevTools. The only oddity is that DevTools works in a
lazy manor: It creates stack traces upfront and as source maps come in,
stack traces get updated. This does not work for the MCP server.
Instead, we wait for script parsed events and source maps to attach
before creating the stack trace. Since this could take potentially a
while, we guard it with a time out.
2026-01-20 09:58:29 +00:00
Alex Rudenko c29d097b92 chore: extract issue formatter in preparation to structured content (#794)
This makes it easier to add JSON-format as the output for issues.
Console formatter will be changed next.
2026-01-20 07:03:30 +00:00
zyzyzyryxy 3c8ce2d281 chore: Remove file unused after bundling from published package (#785)
build/src/third_party/devtools.js is only used during bundling, but we
publish it unnecessarily. We should remove it to not cause confusion and
slightly decrease package size.

Co-authored-by: Piotr Paulski <piotrpaulski@chromium.org>
2026-01-19 11:42:58 +00:00
Simon Zünd 7ba63a8777 chore(build): add devtools-formatter-worker.ts bundle (#792)
The `devtools-formatter-worker` is a separate entrypoint from the MCP
entrypoint. It is identical to the upstream
`front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.js`
and a required part to make source mapping, formatting and other
AST-based DevTools features work.

The implementation consists of 3 parts:
1) A trivial `devtools-formatter-worker.ts` file that imports the
DevTools entrypoint.
2) A new bundle output, bundling everything that needs to run in the
worker.
3) A call that initializes the `FormatterWorkerPool` with the custom
entrypoint. Otherwise we'd use the unbundled entrypoint from
`chrome-devtools-frontend` not available to us at runtime.

Note that we could improve code splitting in the future as some things
like `core/common` are now bundled twice.

---------

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2026-01-19 09:18:08 +00:00
Alex Rudenko 657b996733 build: namespace devtools exports (#662) 2025-12-11 13:12:01 +01:00
Alex Rudenko 94b899c205 build: bundle devtools frontend (#656) 2025-12-11 11:51:04 +01:00
Simon Zünd 2c1061b091 chore: skip all pauses in all DevTools universes (#631) 2025-11-28 13:04:58 +00:00
Simon Zünd 589d994974 chore: add UniverseManager to create DevTools Universes for each Page (#621)
A follow-up PR will add a single instance of the `UniverseManager` to
`McpContext` similarly to the *Collectors. We don't do that in this PR
yet, as we need to wait for some chrome-devtools-frontend changes to
roll.
2025-11-28 09:19:50 +00:00
Simon Zünd 0b12688a40 chore: suppress DevTools CDP command errors (#627)
This PR suppresses all the CDP command errors that DevTools logs via
`console.error`. (mostly `Storage.getStorageKey` errors). These
`console.error`s could also break MCP client that don't ignore invalid
JSON on stdio.
2025-11-28 08:25:27 +00:00
Alex Rudenko 52533d0c69 fix: ignore hash parts of URLs when finding DevTools (#608)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/607
2025-11-26 11:10:34 +01:00
Natasha Gorshunova 326c279179 chore: report console issues in get_console_messages (#594)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
2025-11-25 11:41:14 +01:00
Alex Rudenko a5c40d14a9 chore: remove i18n mocks (#576)
i18n can now run in node.js.
2025-11-19 09:32:54 +00:00
Natasha Gorshunova c1e4118992 feat: report console issues in list_console_messages (#505)
Co-authored-by: Natallia Harshunova <nharshunova@chromium.org>
Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
2025-11-17 10:38:46 +01:00
Alex Rudenko 1560ff23ca refactor: detect DevTools page for each page (#467) 2025-10-27 09:53:34 +00:00