From b34da61524ef8fa3eef838bb489237a4ed1dfe69 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 2 Aug 2022 18:59:42 +0200 Subject: [PATCH] docs: be more clear about connect/launchServer version match (#16134) --- docs/src/api/class-browsertype.md | 4 ++-- packages/playwright-core/types/types.d.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md index 486390830d..5be5ef5cc2 100644 --- a/docs/src/api/class-browsertype.md +++ b/docs/src/api/class-browsertype.md @@ -89,7 +89,7 @@ class BrowserTypeExamples * since: v1.8 - returns: <[Browser]> -This method attaches Playwright to an existing browser instance. +This method attaches Playwright to an existing browser instance. When connecting to another browser launched via `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is compatible with 1.2.x). ### param: BrowserType.connect.wsEndpoint * since: v1.10 @@ -283,7 +283,7 @@ use a temporary directory instead. * langs: js - returns: <[BrowserServer]> -Returns the browser app instance. +Returns the browser app instance. You can connect to it via [`method: BrowserType.connect`], which requires the major/minor client/server version to match (1.2.3 → is compatible with 1.2.x). Launches browser server that client can connect to. An example of launching a browser executable and connecting to it later: diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.ts index d66f9e823b..7623c5d821 100644 --- a/packages/playwright-core/types/types.d.ts +++ b/packages/playwright-core/types/types.d.ts @@ -10379,7 +10379,9 @@ export interface BrowserType { */ connectOverCDP(options: ConnectOverCDPOptions & { wsEndpoint?: string }): Promise; /** - * This method attaches Playwright to an existing browser instance. + * This method attaches Playwright to an existing browser instance. When connecting to another browser launched via + * `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is + * compatible with 1.2.x). * @param wsEndpoint A browser websocket endpoint to connect to. * @param options */ @@ -10391,7 +10393,9 @@ export interface BrowserType { * @deprecated */ /** - * This method attaches Playwright to an existing browser instance. + * This method attaches Playwright to an existing browser instance. When connecting to another browser launched via + * `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is + * compatible with 1.2.x). * @param wsEndpoint A browser websocket endpoint to connect to. * @param options */ @@ -10835,7 +10839,9 @@ export interface BrowserType { }): Promise; /** - * Returns the browser app instance. + * Returns the browser app instance. You can connect to it via + * [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect), + * which requires the major/minor client/server version to match (1.2.3 → is compatible with 1.2.x). * * Launches browser server that client can connect to. An example of launching a browser executable and connecting to it * later: