Skip to main content

Module console

Module console 

Source
Expand description

Captured console.* output with size limits.

The engine installs a console global inside every script context. Each call (console.log, .info, .warn, .error, .debug) pushes an entry into a shared ConsoleCapture. Output is bounded by three limits:

  • max entries (count-based),
  • max total bytes (sum of message lengths),
  • max per-entry bytes (individual message truncation).

When a limit is hit, a single system-level entry is appended noting truncation and no further entries are recorded.

Structs§

ConsoleCapture
Thread-safe capture buffer.

Functions§

strip_ansi
Strip ANSI escape sequences from a captured message so malicious page content (or legitimate page console.log bridged through) cannot poison logs with terminal control codes.