PR comments

This commit is contained in:
Adam Gastineau 2025-01-30 11:56:56 -08:00
parent cb9ac24c8b
commit 7910849607
2 changed files with 23 additions and 13 deletions

View file

@ -90,20 +90,28 @@ class BrowserTypeExamples
* langs: js
- returns: <[Browser]>
This method attaches Playwright to an existing browser instance created via [`method: BrowserType.launchServer`], which can only be run from Node.js. When connecting to another browser, the major and minor version of the Playwright instance you're calling from needs to match the client browser version (1.2.3 → is compatible with 1.2.x).
This method attaches Playwright to an existing browser instance created via [`method: BrowserType.launchServer`].
:::note
The major and minor version of the Playwright instance that connects needs to match the version of Playwright that launches the browser (1.2.3 → is compatible with 1.2.x).
:::
## async method: BrowserType.connect
* since: v1.8
* langs: python, csharp, java
- returns: <[Browser]>
This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js. When connecting to another browser, the major and minor version of the Playwright instance you're calling from needs to match the client browser version (1.2.3 → is compatible with 1.2.x).
This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
:::note
The major and minor version of the Playwright instance that connects needs to match the version of Playwright that launches the browser (1.2.3 → is compatible with 1.2.x).
:::
### param: BrowserType.connect.wsEndpoint
* since: v1.10
- `wsEndpoint` <[string]>
A Playwright browser websocket endpoint to connect to. You obtain this endpoint via [`method: BrowserServer.wsEndpoint`]
A Playwright browser websocket endpoint to connect to. You obtain this endpoint via [`method: BrowserServer.wsEndpoint`].
### option: BrowserType.connect.headers
* since: v1.11

View file

@ -14604,12 +14604,13 @@ export interface BrowserType<Unused = {}> {
connectOverCDP(options: ConnectOverCDPOptions & { wsEndpoint?: string }): Promise<Browser>;
/**
* This method attaches Playwright to an existing browser instance created via
* [browserType.launchServer([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server),
* which can only be run from Node.js. When connecting to another browser, the major and minor version of the
* Playwright instance you're calling from needs to match the client browser version (1.2.3 is compatible with
* 1.2.x).
* [browserType.launchServer([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server).
*
* **NOTE** The major and minor version of the Playwright instance that connects needs to match the version of
* Playwright that launches the browser (1.2.3 is compatible with 1.2.x).
*
* @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via
* [browserServer.wsEndpoint()](https://playwright.dev/docs/api/class-browserserver#browser-server-ws-endpoint)
* [browserServer.wsEndpoint()](https://playwright.dev/docs/api/class-browserserver#browser-server-ws-endpoint).
* @param options
*/
connect(wsEndpoint: string, options?: ConnectOptions): Promise<Browser>;
@ -14621,12 +14622,13 @@ export interface BrowserType<Unused = {}> {
*/
/**
* This method attaches Playwright to an existing browser instance created via
* [browserType.launchServer([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server),
* which can only be run from Node.js. When connecting to another browser, the major and minor version of the
* Playwright instance you're calling from needs to match the client browser version (1.2.3 is compatible with
* 1.2.x).
* [browserType.launchServer([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server).
*
* **NOTE** The major and minor version of the Playwright instance that connects needs to match the version of
* Playwright that launches the browser (1.2.3 is compatible with 1.2.x).
*
* @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via
* [browserServer.wsEndpoint()](https://playwright.dev/docs/api/class-browserserver#browser-server-ws-endpoint)
* [browserServer.wsEndpoint()](https://playwright.dev/docs/api/class-browserserver#browser-server-ws-endpoint).
* @param options
*/
connect(options: ConnectOptions & { wsEndpoint?: string }): Promise<Browser>;