ICDPSession
Namespace: PuppeteerSharp
public interface ICDPSession : ICDPConnectionThe CDPSession instances are used to talk raw Chrome Devtools Protocol:
- Protocol methods can be called with
CommandOptions)method. - Protocol events, using the MessageReceived event.
Documentation on DevTools Protocol can be found here: <a href=“https://chromedevtools.github.io/devtools-protocol/">https://chromedevtools.github.io/devtools-protocol/</a>.
var client = await Page.Target.CreateCDPSessionAsync();await client.SendAsync("Animation.enable");client.MessageReceived += (sender, e) =>{ if (e.MessageID == "Animation.animationCreated") { Console.WriteLine("Animation created!"); }};JObject response = await client.SendAsync("Animation.getPlaybackRate");Console.WriteLine("playback rate is " + response.playbackRate);await client.SendAsync("Animation.setPlaybackRate", new{ playbackRate = Convert.ToInt32(response.playbackRate / 2)});Derived: BidiCdpSession, CDPSession, CdpCDPSession
Made with love by Dario Kondratiuk