Interface ConnectOverCDPOptions

interface ConnectOverCDPOptions {
    artifactsDir?: string;
    endpointURL?: string;
    headers?: {
        [key: string]: string;
    };
    isLocal?: boolean;
    noDefaults?: boolean;
    slowMo?: number;
    timeout?: number;
}

Properties

artifactsDir?: string

If specified, browser artifacts (such as traces and downloads) are saved into this directory.

endpointURL?: string

Deprecated

Use the first argument instead.

headers?: {
    [key: string]: string;
}

Additional HTTP headers to be sent with connect request. Optional.

Type declaration

  • [key: string]: string
isLocal?: boolean

Tells Playwright that it runs on the same host as the CDP server. It will enable certain optimizations that rely upon the file system being the same between Playwright and the Browser.

noDefaults?: boolean

When true, Playwright will not apply its default overrides to the existing default browser context. Specifically, acceptDownloads is left at the browser's setting, focus emulation is not enabled, and media emulation options (such as colorScheme, reducedMotion, forcedColors, and contrast) are not applied. Useful when attaching to a user's daily-driver browser where these overrides would interfere with existing browser state. New contexts created via browser.newContext([options]) are not affected. Defaults to false.

slowMo?: number

Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.

timeout?: number

Maximum time in milliseconds to wait for the connection to be established. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.