Skip to content

Commit 3d5f85d

Browse files
authored
Revert "chore(docs): clarify connection method via BrowserType.connect (#34560)" (#34594)
1 parent ebf82b0 commit 3d5f85d

File tree

2 files changed

+10
-48
lines changed

2 files changed

+10
-48
lines changed

docs/src/api/class-browsertype.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,31 +87,15 @@ class BrowserTypeExamples
8787

8888
## async method: BrowserType.connect
8989
* since: v1.8
90-
* langs: js
9190
- returns: <[Browser]>
9291

93-
This method attaches Playwright to an existing browser instance created via [`method: BrowserType.launchServer`].
94-
95-
:::note
96-
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).
97-
:::
98-
99-
## async method: BrowserType.connect
100-
* since: v1.8
101-
* langs: python, csharp, java
102-
- returns: <[Browser]>
103-
104-
This method attaches Playwright to an existing browser instance created via `BrowserType.launchServer` in Node.js.
105-
106-
:::note
107-
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).
108-
:::
92+
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).
10993

11094
### param: BrowserType.connect.wsEndpoint
11195
* since: v1.10
11296
- `wsEndpoint` <[string]>
11397

114-
A Playwright browser websocket endpoint to connect to. You obtain this endpoint via [`method: BrowserServer.wsEndpoint`].
98+
A browser websocket endpoint to connect to.
11599

116100
### option: BrowserType.connect.headers
117101
* since: v1.11
@@ -168,10 +152,6 @@ The default browser context is accessible via [`method: Browser.contexts`].
168152
Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
169153
:::
170154

171-
:::note
172-
This connection is significantly lower fidelity than the Playwright protocol connection via [`method: BrowserType.connect`]. If you are experiencing issues or attempting to use advanced functionality, you probably want to use [`method: BrowserType.connect`].
173-
:::
174-
175155
**Usage**
176156

177157
```js

packages/playwright-core/types/types.d.ts

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14554,11 +14554,6 @@ export interface BrowserType<Unused = {}> {
1455414554
*
1455514555
* **NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
1455614556
*
14557-
* **NOTE** This connection is significantly lower fidelity than the Playwright protocol connection via
14558-
* [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14559-
* If you are experiencing issues or attempting to use advanced functionality, you probably want to use
14560-
* [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14561-
*
1456214557
* **Usage**
1456314558
*
1456414559
* ```js
@@ -14584,11 +14579,6 @@ export interface BrowserType<Unused = {}> {
1458414579
*
1458514580
* **NOTE** Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
1458614581
*
14587-
* **NOTE** This connection is significantly lower fidelity than the Playwright protocol connection via
14588-
* [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14589-
* If you are experiencing issues or attempting to use advanced functionality, you probably want to use
14590-
* [browserType.connect(wsEndpoint[, options])](https://playwright.dev/docs/api/class-browsertype#browser-type-connect).
14591-
*
1459214582
* **Usage**
1459314583
*
1459414584
* ```js
@@ -14603,14 +14593,10 @@ export interface BrowserType<Unused = {}> {
1460314593
*/
1460414594
connectOverCDP(options: ConnectOverCDPOptions & { wsEndpoint?: string }): Promise<Browser>;
1460514595
/**
14606-
* This method attaches Playwright to an existing browser instance created via
14607-
* [browserType.launchServer([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server).
14608-
*
14609-
* **NOTE** The major and minor version of the Playwright instance that connects needs to match the version of
14610-
* Playwright that launches the browser (1.2.3 → is compatible with 1.2.x).
14611-
*
14612-
* @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via
14613-
* [browserServer.wsEndpoint()](https://playwright.dev/docs/api/class-browserserver#browser-server-ws-endpoint).
14596+
* This method attaches Playwright to an existing browser instance. When connecting to another browser launched via
14597+
* `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is
14598+
* compatible with 1.2.x).
14599+
* @param wsEndpoint A browser websocket endpoint to connect to.
1461414600
* @param options
1461514601
*/
1461614602
connect(wsEndpoint: string, options?: ConnectOptions): Promise<Browser>;
@@ -14621,14 +14607,10 @@ export interface BrowserType<Unused = {}> {
1462114607
* @deprecated
1462214608
*/
1462314609
/**
14624-
* This method attaches Playwright to an existing browser instance created via
14625-
* [browserType.launchServer([options])](https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server).
14626-
*
14627-
* **NOTE** The major and minor version of the Playwright instance that connects needs to match the version of
14628-
* Playwright that launches the browser (1.2.3 → is compatible with 1.2.x).
14629-
*
14630-
* @param wsEndpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via
14631-
* [browserServer.wsEndpoint()](https://playwright.dev/docs/api/class-browserserver#browser-server-ws-endpoint).
14610+
* This method attaches Playwright to an existing browser instance. When connecting to another browser launched via
14611+
* `BrowserType.launchServer` in Node.js, the major and minor version needs to match the client version (1.2.3 → is
14612+
* compatible with 1.2.x).
14613+
* @param wsEndpoint A browser websocket endpoint to connect to.
1463214614
* @param options
1463314615
*/
1463414616
connect(options: ConnectOptions & { wsEndpoint?: string }): Promise<Browser>;

0 commit comments

Comments
 (0)