diff --git a/lib/Connection.js b/lib/Connection.js index fa4501b0..dbf1ea8f 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -201,6 +201,7 @@ class Session extends EventEmitter { } async dispose() { + console.assert(!!this._connection, 'Protocol error: Connection closed. Most likely the page has been closed.'); await this._connection.send('Target.closeTarget', {targetId: this._targetId}); }