文件历史

提交图

13 次代码提交

作者 SHA1 备注 提交日期
Nikolay Vitkov bede4fbdfa chore: install HostBindingAdapter (#2186)
This PR introduces the HostBindingAdapter to utilize the functions
usually available to DevTools.
Additionally I moved all the DevTools related files under a `devtools`
directory to better separate the extractor logic.
The patch scripts for DevTools were moved under a function to remove the
side-effect nature of the file.
Now gets called in a the creation of the McpContext (and a before hook
in test.)
2026-06-09 12:18:25 +00:00
Alex Rudenko f8fb2a9236 test: drop node20 code in tests (#2146) 2026-05-27 11:12:22 +00:00
Alex Rudenko 0d78685a5b refactor: cleanup string and structured console formatters (#1005)
- typed JSON objects for structured output
- same source is used for text formatting
2026-02-20 11:43:35 +00:00
Simon Zünd 8e2380b434 fix: console formatter hides frames from ignored scripts (#927)
This PR wires up the default DevTools ignore listing to hide frames from
third party scripts in stack traces. By default, we ignore:

* Scripts with `/node_modules/` in their URL or where the URL starts
with `node:/`
* Scripts that are marked as ignore listed in the source map
* Content scripts from extensions

The PR adds both, unit tests and an e2e test. This is because we allow
the unit test to pass a mocked ignore checker, where-as the e2e uses the
real DevTools one.
2026-02-10 07:24:09 +00:00
Simon Zünd caea23a7cf fix: limit stack traces to 50 lines (#923)
This PR refactors the stack trace formatting logic a bit: We split the
`formatStackTrace` function into 2: One for the top-level stack trace
and the rest for the recursive ones. We also return lines separately so
we can slice the result later.
2026-02-09 12:06:04 +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
Alex Rudenko dc43ede1f2 fix: improve error handling for console messages (#844)
Closes https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/838
2026-01-27 12:27:10 +00:00
Alex Rudenko b0d041a0b2 chore: structured content for console (#804) 2026-01-22 06:53:03 +00:00
Alex Rudenko feee900a4c chore: create a console formatter class (#802)
This cleans up the McpResponse and helps with returning the structured
content.
2026-01-21 10:04:20 +00:00