English · Java
Appearance
English · Java
Appearance
The CDPSession instances are used to talk raw Chrome Devtools Protocol:
session.send method.session.on method.Useful links:
CDPSession client = page.context().newCDPSession(page);
client.send("Runtime.enable");
client.on("Animation.animationCreated", (event) -> System.out.println("Animation created!"));
JsonObject response = client.send("Animation.getPlaybackRate");
double playbackRate = response.get("playbackRate").getAsDouble();
System.out.println("playback rate is " + playbackRate);
JsonObject params = new JsonObject();
params.addProperty("playbackRate", playbackRate / 2);
client.send("Animation.setPlaybackRate", params);Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to send messages.
Unregister an event handler for events with the specified event name. The given handler will not be called anymore for events with the given name.
Arguments
Register an event handler for events with the specified event name. The given handler will be called for every event with the given name.
Arguments
Arguments
Returns
JsonObjectEmitted when the session is closed, either because the target was closed or session.detach() was called.
Event data
CDPSession