chrome-remote-interface
Advanced tools
Comparing version 0.32.1 to 0.32.2
@@ -114,2 +114,3 @@ 'use strict'; | ||
this._ws.removeAllListeners(); | ||
this._handleConnectionClose(); | ||
callback(); | ||
@@ -243,2 +244,3 @@ }); | ||
this._ws.on('close', (code) => { | ||
this._handleConnectionClose(); | ||
this.emit('disconnect'); | ||
@@ -252,2 +254,11 @@ }); | ||
_handleConnectionClose() { | ||
// make sure to complete all the unresolved callbacks | ||
const err = new Error('WebSocket connection closed'); | ||
for (const callback of Object.values(this._callbacks)) { | ||
callback(true, err); | ||
} | ||
this._callbacks = {}; | ||
} | ||
// handle the messages read from the WebSocket | ||
@@ -254,0 +265,0 @@ _handleMessage(message) { |
@@ -18,3 +18,3 @@ { | ||
"homepage": "https://github.com/cyrus-and/chrome-remote-interface", | ||
"version": "0.32.1", | ||
"version": "0.32.2", | ||
"repository": { | ||
@@ -21,0 +21,0 @@ "type": "git", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1833777
26023