mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(browser): Add browser.isConnected() (#4403)
Add `browser.isConnected()` to the public api to be able to tell when the browser is connected fixes https://github.com/smooth-code/jest-puppeteer/pull/237#issuecomment-490260041
This commit is contained in:
committed by
Andrey Lushnikov
parent
13f73b5b3a
commit
511dcf9d32
@@ -57,6 +57,13 @@ class Browser extends EventEmitter {
|
||||
this._connection.dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean}
|
||||
*/
|
||||
isConnected() {
|
||||
return !this._connection._closed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!BrowserContext}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user