PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteUse await page.createCDPSession() to attach a Chrome DevTools Protocol (CDP) session to a Puppeteer page. Then call send() to issue protocol commands and on() to listen for protocol events. When finished, call detach() if you want to end the session explicitly.
Create a CDP session for a page
The direct page-level API is Page.createCDPSession(). The following example launches a browser, creates a page session, enables the Animation domain, listens for an animation event, and then detaches the session before closing the browser. It follows Puppeteer’s documented API and Animation-domain example; confirm that the command is available in the browser version your project uses.
As an Amazon Associate I earn from qualifying purchases.
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
const cdp = await page.createCDPSession();
await cdp.send('Animation.enable');
cdp.on('Animation.animationCreated', event => {
console.log(event);
});
// Use the page and CDP session here.
await cdp.detach();
} finally {
await browser.close();
}
The session returned by this call is attached to the page. Puppeteer documents the method in its Page.createCDPSession() API reference.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Send commands and listen for events
A CDPSession is Puppeteer’s interface for raw Chrome DevTools Protocol communication. Call send(method, params) to send a protocol method, and subscribe to a protocol event with on(event, listener). For example, await cdp.send('Animation.enable') enables that domain; the listener receives the event payload when Animation.animationCreated fires.
#1 Best Overall
Check the relevant protocol definition and browser version before relying on a command. The session API does not guarantee that every CDP command is available in every Chrome or Chromium release. Puppeteer’s CDPSession reference describes the session interface and includes an official Animation-domain example.
Choose the right attachment point
| Need | API | When to use it |
|---|---|---|
| Attach to a page | await page.createCDPSession() |
The direct, current page-level method. |
| Attach to another debuggable target | await target.createCDPSession() |
Use when your chosen CDP target, rather than the page API, is the intended attachment point. Puppeteer describes targets as debuggable entities such as frames, pages, or workers. |
See Puppeteer’s Target.createCDPSession() reference for target-level attachment. Do not use page.target().createCDPSession() as the recommended page route: Puppeteer marks Page.target() obsolete and directs users to Page.createCDPSession() instead (Page.target() reference).
Rank #2
Detach and understand session state
Calling await cdp.detach() detaches the session from its target. A detached session no longer emits events and cannot send messages. The read-only cdp.detached property reports whether it is detached. Do not construct or subclass CDPSession yourself; Puppeteer marks its constructor internal.
Free tools Windows power users keep installed
One-click scans. No signup required.
Check browser and protocol compatibility
Puppeteer’s documented protocol selection defaults depend on how the browser is used: launching Chrome selects CDP, launching Firefox selects WebDriver BiDi, and connecting to a browser selects CDP. These defaults are documented in the current ConnectOptions reference and may evolve, so verify the configuration in your own project when CDP support matters.
Puppeteer’s API reference links to the DevTools Protocol Viewer and the “Getting Started with DevTools Protocol” material for protocol details. Validate an individual command against the protocol and browser version you actually target.
Troubleshoot common problems
- The session cannot send a command: Check whether
detach()has already been called. Detached sessions cannot send messages; create a new session for the target if needed. - No event arrives: Confirm that the relevant protocol domain has been enabled, that the event name is correct, and that the browser command/event exists in the protocol version in use. Register the listener before the action that should trigger the event.
- The method is unavailable: Use
page.createCDPSession()for a page rather than the obsoletepage.target()route. Confirm the Puppeteer version and API surface in your project. - CDP behavior differs by browser: Check whether your setup launches Chrome, launches Firefox, or connects to a browser, then verify the runtime protocol configuration. CDP-specific commands require a CDP-compatible connection.
Or skip the browser setup
If your goal is a website screenshot rather than custom CDP control, ScreenshotNeo returns an image or PDF from one GET request. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots a month are free with no card; paid plans start at $5 for 3,000. See the API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Sign up for 1,000 free screenshots a month, with no card.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




