The CDPSession instances are used to talk raw Chrome Devtools Protocol:
session.send method.session.on method.Useful links:
const client = await page.context().newCDPSession(page);
await client.send('Animation.enable');
client.on('Animation.animationCreated', () => console.log('Animation created!'));
const response = await client.send('Animation.getPlaybackRate');
console.log('playback rate is ' + response.playbackRate);
await client.send('Animation.setPlaybackRate', {
playbackRate: response.playbackRate / 2
}); 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
await cdpSession.detach();
Returns
Usage
await cdpSession.send(method); await cdpSession.send(method, params);
Arguments
Returns
© 2025 Microsoft
Licensed under the Apache License, Version 2.0.
https://playwright.dev/docs/api/class-cdpsession