clj-chrome-devtools.events

Listening to events coming from Chrome.

default-wait-ms

listen

(listen domain event callback)(listen connection domain event callback)

Subscribe to listen to given domain event. Both domain and event are keywords. Returns a 0-arity function that removes the listener when invoked.

listen-once

(listen-once domain event)(listen-once connection domain event)

Synchronously listen for an event once, remove the listener and return the event.

unlisten

(unlisten domain event callback)(unlisten connection domain event callback)

Remove the listening callback from the subscribers of the specified domain event type.

wait-for-event

(wait-for-event domain event params)(wait-for-event connection domain event params)(wait-for-event connection domain event params timeout-ms)(wait-for-event connection domain event params timeout-ms after-attach-listener-fn)

Synchronously wait for an event with specific parameters.

with-event-wait

macro

(with-event-wait domain event body)(with-event-wait connection domain event body)(with-event-wait connection domain event timeout-ms body)

Execute body that causes some later events and wait for the event before returning. If the event is not received after waiting timeout-ms milliseconds, an exception is thrown.