chrome.tabCapture and runs in the extension context, so it survives page navigation. Unlike getDisplayMedia, the extension holds the MediaRecorder, not the page.12345await recording.start({ page: state.page, outputPath: '/absolute/path/to/recording.mp4', frameRate: 30, })
1234await state.page.click('a') await state.page.waitForLoadState('domcontentloaded') await state.page.goBack() // Still recording
12state.recordingResult = await recording.stop({ page: state.page }) // => { path, duration, executionTimestamps }
state because executionTimestamps is needed for createDemoVideo.| Parameter | Type | Default | Description |
page | Page | required | Page to record |
outputPath | string | required | Absolute path for the output MP4 |
frameRate | number | 30 | Frames per second |
audio | boolean | false | Record tab audio |
videoBitsPerSecond | number | 2500000 | Video bitrate |
aspectRatio | object | null | { width: 16, height: 9 } | Auto-resize viewport; null to skip |
maxDurationMs | number | 15 min | Auto-stop safety limit; 0 to disable |
12345// Check if recording is active await recording.isRecording({ page: state.page }) // Cancel recording without saving await recording.cancel({ page: state.page })
123456// Change cursor style await ghostCursor.show({ page: state.page, style: 'screenstudio' }) // Styles: 'minimal' (default), 'dot', 'screenstudio' // Temporarily hide the cursor await ghostCursor.hide({ page: state.page })
locator.click(), page.mouse.move()) instead of goto() to show realistic cursor motion.createDemoVideo to speed up idle sections (time between execute calls) while keeping interactions at normal speed. Requires ffmpeg and ffprobe installed.12345678910// First, stop recording and save the result state.recordingResult = await recording.stop({ page: state.page }) // Then in a SEPARATE execute call (with --timeout 120000): const demoPath = await createDemoVideo({ recordingPath: state.recordingResult.path, durationMs: state.recordingResult.duration, executionTimestamps: state.recordingResult.executionTimestamps, speed: 6, // default 6x for idle sections })
--timeout 120000 or higher.chrome.tabCapture which requires the extension. Not available in direct CDP mode or headless mode.maxDurationMs.aspectRatio: null to keep the current size.123456789# macOS open -a "Google Chrome" --args \ --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe \ --auto-accept-this-tab-capture # Linux google-chrome \ --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe \ --auto-accept-this-tab-capture &