console

command
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Command console is a chromedp example demonstrating how to read the console of a page and its uncaught exceptions with chromedp.Console. The program loads a local page that calls console.log, console.warn and console.error with strings and objects. After a click, the page throws an exception that nothing catches, rejects a promise that nothing handles, and loads an image that does not exist, which the browser reports as an error of the network. The program prints every message in order, with its type, its text, its place (URL, line and column) and the first lines of the stack trace of an exception. Then it shows how to read only some types, and how to stop reading with a break and with a canceled context. It starts a local server and needs no internet. Use -v to print the protocol messages and -visible to show the browser window and leave it open. Use -visible-on-terminal to draw the page in the terminal with terminal graphics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL