Commit 2d4317d 1 parent f5a530e commit 2d4317d Copy full SHA for 2d4317d
File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,16 @@ The [Browser] object itself is considered to be disposed and cannot be used anym
173
173
#### browser.contexts()
174
174
- returns: <[ Array] <[ BrowserContext] >>
175
175
176
- Returns an array of all open browser contexts. In a newly created browser, this will return
177
- a single instance of [ BrowserContext] .
176
+ Returns an array of all open browser contexts. In a newly created browser, this will return zero
177
+ browser contexts.
178
+
179
+ ``` js
180
+ const browser = await pw .webkit .launch ();
181
+ console .log (browser .contexts ().length ); // prints `0`
182
+
183
+ const context = await browser .newContext ();
184
+ console .log (browser .contexts ().length ); // prints `1`
185
+ ```
178
186
179
187
#### browser.isConnected()
180
188
You can’t perform that action at this time.
0 commit comments