A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://playwright.dev/java/docs/api/class-cdpsession below:

CDPSession | Playwright Java

CDPSession

The CDPSession instances are used to talk raw Chrome Devtools Protocol:

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);
Methods detachAdded before v1.9 cdpSession.detach

Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to send messages.

Usage

Returns

offAdded in: v1.37 cdpSession.off

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.

Usage

CDPSession.off(eventName, handler);

Arguments

onAdded in: v1.37 cdpSession.on

Register an event handler for events with the specified event name. The given handler will be called for every event with the given name.

Usage

CDPSession.on(eventName, handler);

Arguments

sendAdded before v1.9 cdpSession.send

Usage

CDPSession.send(method);
CDPSession.send(method, args);

Arguments

Returns


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4