Console Monitor
Import
Section titled “Import”import { startConsoleMonitor } from "webotron/plugins/console-monitor";Entry Point
Section titled “Entry Point”startConsoleMonitor(view, handlers?)
const monitor = await startConsoleMonitor(view, { onMessage: (message) => console.log(message.level, message.text), onError: (message) => console.error(message.text),});
// ... run automationawait monitor.stop();Handlers
Section titled “Handlers”| Handler | Purpose |
|---|---|
onMessage | Receive every normalized console/exception message. |
onLog | Receive log/info/debug-style entries. |
onWarning | Receive warning entries. |
onError | Receive error entries and exceptions. |
- Enables
RuntimeandLogCDP domains. - Converts console and exception events into a typed message stream.
- Lets you subscribe to
onMessage,onLog,onWarning, andonErrorcallbacks.