docs: fix browser.contexts() description (#1220)

This commit is contained in:
Yury Semikhatsky 2020-03-04 12:05:18 -08:00 committed by GitHub
parent f5a530e17f
commit 2d4317dc9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,8 +173,16 @@ The [Browser] object itself is considered to be disposed and cannot be used anym
#### browser.contexts()
- returns: <[Array]<[BrowserContext]>>
Returns an array of all open browser contexts. In a newly created browser, this will return
a single instance of [BrowserContext].
Returns an array of all open browser contexts. In a newly created browser, this will return zero
browser contexts.
```js
const browser = await pw.webkit.launch();
console.log(browser.contexts().length); // prints `0`
const context = await browser.newContext();
console.log(browser.contexts().length); // prints `1`
```
#### browser.isConnected()