From 27d3ed83751f4d41273bdaa89a3f8e136fc0eb9e Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Fri, 8 Jul 2016 17:27:09 -0700 Subject: [PATCH] Reuse existing tab fallback (for Chrome headless) --- lighthouse-core/driver/drivers/cri.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lighthouse-core/driver/drivers/cri.js b/lighthouse-core/driver/drivers/cri.js index 5247e76b28bd..a1e2a836f78e 100644 --- a/lighthouse-core/driver/drivers/cri.js +++ b/lighthouse-core/driver/drivers/cri.js @@ -38,7 +38,7 @@ class CriDriver extends Driver { /* eslint-disable new-cap */ chromeRemoteInterface.New((err, tab) => { if (err) { - return reject(err); + log.warn('CRI driver', 'cannot create new tab, will reuse tab.', err); } chromeRemoteInterface({port: port, chooseTab: tab}, chrome => { @@ -57,6 +57,7 @@ class CriDriver extends Driver { disconnect() { return new Promise((resolve, reject) => { if (!this._tab) { + this._chrome.close(); return resolve(); }