You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/src/api/class-browsertype.md
+22-2
Original file line number
Diff line number
Diff line change
@@ -87,15 +87,31 @@ class BrowserTypeExamples
87
87
88
88
## async method: BrowserType.connect
89
89
* since: v1.8
90
+
* langs: js
90
91
- returns: <[Browser]>
91
92
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).
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
+
:::
93
109
94
110
### param: BrowserType.connect.wsEndpoint
95
111
* since: v1.10
96
112
-`wsEndpoint` <[string]>
97
113
98
-
A browser websocket endpoint to connect to.
114
+
A Playwright browser websocket endpoint to connect to. You obtain this endpoint via [`method: BrowserServer.wsEndpoint`].
99
115
100
116
### option: BrowserType.connect.headers
101
117
* since: v1.11
@@ -152,6 +168,10 @@ The default browser context is accessible via [`method: Browser.contexts`].
152
168
Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers.
153
169
:::
154
170
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`].
0 commit comments