Console capture. Called for each console.* invocation in the page.
globalThis.console: forward directly to the parent's console. console.log("hi") in the page prints hi to stdout with Bun's formatter; console.error goes to stderr. Zero JS overhead per call — dispatches through ConsoleClient directly.(type, ...args) => void: custom callback. type is the method name ("log" | "warn" | "error" | "info" | "debug" | ...). Primitive args unwrap to their raw values; object args arrive as a structured descriptor — for Chrome, the CDP RemoteObject with .type/.className/.description/.preview.properties; for WebKit, the JSON round-trip of the object (lossy for functions/ circular refs, which stringify to their String(...) coercion).
type alias ConsoleCapture | Bun module | Bun void`: custom callback. `type` is the method
name (`"log"` | `"warn"` | `"error"` | `"info"` | `"debug"` | ...).
Primitive args unwrap to their raw values; object args arrive as a
structured descriptor — for Chrome, the CDP `RemoteObject` with
`.type`/`.className`/`.description`/`.preview.properties`; for
WebKit, the JSON round-trip of the object (lossy for functions/
circular refs, which stringify to their `String(...)` coercion)."/> void`: custom callback. `type` is the method
name (`"log"` | `"warn"` | `"error"` | `"info"` | `"debug"` | ...).
Primitive args unwrap to their raw values; object args arrive as a
structured descriptor — for Chrome, the CDP `RemoteObject` with
`.type`/`.className`/`.description`/`.preview.properties`; for
WebKit, the JSON round-trip of the object (lossy for functions/
circular refs, which stringify to their `String(...)` coercion)."/> BuildDocsReferenceGuidesBlogDiscord/Bun/WebView/ConsoleCaptureTConsoleCapture BuildDocsReferenceGuidesBlogDiscord /Bun/WebView/ConsoleCaptureTConsoleCapture WebView.ConsoleCapture void`: custom callback. `type` is the method
name (`"log"` | `"warn"` | `"error"` | `"info"` | `"debug"` | ...).
Primitive args unwrap to their raw values; object args arrive as a
structured descriptor — for Chrome, the CDP `RemoteObject` with
`.type`/`.className`/`.description`/`.preview.properties`; for
WebKit, the JSON round-trip of the object (lossy for functions/
circular refs, which stringify to their `String(...)` coercion)." data-algolia-static="false" data-algolia-merged="false" data-type="Type alias">type ConsoleCapture = typeof console | (type: string, ...args: unknown[]) => void
Search the reference...
/
type
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →type alias ConsoleCapture | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引
- Console capture. Called for each `console.*` invocation in the page.
- `globalThis.console`: forward directly to the parent