Skip to content

Commit

Permalink
fix: example
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmood committed Apr 10, 2024
1 parent 6a4d1da commit 4391b88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples_test.go
Expand Up @@ -442,8 +442,10 @@ func Example_handle_events() {

// Listen for all events of console output.
go page.EachEvent(func(e *proto.RuntimeConsoleAPICalled) {
fmt.Println(page.MustObjectsToJSON(e.Args))
close(done)
if e.Type == proto.RuntimeConsoleAPICalledTypeLog {
fmt.Println(page.MustObjectsToJSON(e.Args))
close(done)
}
})()

wait := page.WaitEvent(&proto.PageLoadEventFired{})
Expand Down

0 comments on commit 4391b88

Please sign in to comment.