eventsiter

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: 18 Imported by: 0

Documentation

Overview

Command eventsiter is a chromedp example demonstrating how to listen to the events of a page with iterators. chromedp.Events returns an iterator that the program reads with a for loop. The program loads a local page that logs to the console, loads an image and a script, and sends a request later with a script. It collects the console messages, the network requests and the network responses. It waits for the network to be idle with the event Page.lifecycleEvent. It then reads the console messages with a loop that ends with break, and it waits for one console message that matches a condition with WaitEvent. A listener stops when its context ends, so the program cancels the context of the network listeners. 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