docs: update api.md

This patch clarifies when the "disconnected" event is emitted
and emphasizes the difference between Chromium and browser.

References #1589.
This commit is contained in:
Andrey Lushnikov 2018-01-04 02:27:57 -08:00 committed by GitHub
parent 24354a4879
commit 0a498bae3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,8 +322,8 @@ puppeteer.launch().then(async browser => {
});
```
#### event: 'disconnected'
Emitted when puppeteer gets disconnected from the browser instance. This might happen because one of the following:
- browser closed or crashed
Emitted when puppeteer gets disconnected from the Chromium instance. This might happen because one of the following:
- Chromium is closed or crashed
- `browser.disconnect` method was called
#### event: 'targetchanged'