Skip to content

Commit

Permalink
docs: fix browser.contexts() description (#1220)
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Mar 4, 2020
1 parent f5a530e commit 2d4317d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 2d4317d

Please sign in to comment.