Skip to content

CdpConnection.captureScreenshot

CdpConnection › captureScreenshot

Type: (params?: Except<CaptureScreenshotParams, 'cwd'>) => Promise<Uint8Array>

Captures a PNG screenshot of this connection's Obsidian window, with the vault path pre-bound.

Pass widthInPixels + heightInPixels to pin the viewport for the duration of the capture, so the emitted PNG is exactly that size whatever size the window happens to be.