diff --git a/lighthouse-core/gather/driver.js b/lighthouse-core/gather/driver.js index 3e7b7ebda902..5da3e6322294 100644 --- a/lighthouse-core/gather/driver.js +++ b/lighthouse-core/gather/driver.js @@ -1196,17 +1196,16 @@ class Driver { * @return {Promise} */ async dismissJavaScriptDialogs() { - await this.sendCommand('Page.enable'); - this.on('Page.javascriptDialogOpening', data => { log.warn('Driver', `${data.type} dialog opened by the page automatically suppressed.`); - // rejection intentionally unhandled this.sendCommand('Page.handleJavaScriptDialog', { accept: true, promptText: 'Lighthouse prompt response', - }); + }).catch(err => log.warn('Driver', err)); }); + + await this.sendCommand('Page.enable'); } }