Enables visual annotations on interacted elements. Returns a disposable that stops showing actions when disposed.
Optional options: { Optional duration?: numberHow long each annotation is displayed in milliseconds. Defaults to 500.
Optional fontFont size of the action title in pixels. Defaults to 24.
Optional position?: "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right"Position of the action title overlay. Defaults to "top-right".
Shows a chapter overlay with a title and optional description, centered on the page with a blurred backdrop. Useful for narrating video recordings. The overlay is removed after the specified duration, or 2000ms.
Title text displayed prominently in the overlay.
Optional options: { Optional description?: stringOptional description text displayed below the title.
Optional duration?: numberDuration in milliseconds after which the overlay is automatically removed. Defaults to 2000.
Adds an overlay with the given HTML content. The overlay is displayed on top of the page until removed. Returns a disposable that removes the overlay when disposed.
HTML content for the overlay.
Optional options: { Optional duration?: numberDuration in milliseconds after which the overlay is automatically removed. Overlay stays until dismissed if not provided.
Starts the screencast. When path
is provided, it saves video recording to the specified file. When
onFrame is provided,
delivers JPEG-encoded frames to the callback. Both can be used together.
Usage
// Record video
await page.screencast.start({ path: 'video.webm', size: { width: 1280, height: 800 } });
// ... perform actions ...
await page.screencast.stop();
// Capture frames
await page.screencast.start({
onFrame: ({ data }) => console.log(`frame size: ${data.length}`),
size: { width: 800, height: 600 },
});
// ... perform actions ...
await page.screencast.stop();
Optional options: { Optional annotate?: { Optional duration?: numberOptional fontOptional position?: "top-left" | "top" | "top-right" | "bottom-left" | "bottom" | "bottom-right"Optional onOptional path?: stringOptional quality?: numberOptional size?: { Stops the screencast and video recording if active. If a video was being recorded, saves it to the path specified in screencast.start([options]).
Interface for capturing screencast frames from a page.