Skip to content

Commit

Permalink
Don't wait for Page.navigate's resolution (#3413)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored Sep 26, 2017
1 parent b212dc7 commit 43e93bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lighthouse-core/gather/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,14 @@ class Driver {
/* eslint-enable max-len */

return this._beginNetworkStatusMonitoring(url)
.then(_ => this.sendCommand('Page.enable'))
.then(_ => this.sendCommand('Emulation.setScriptExecutionDisabled', {value: disableJS}))
.then(_ => this.sendCommand('Page.navigate', {url}))
.then(_ => {
// These can 'race' and that's OK.
// We don't want to wait for Page.navigate's resolution, as it can now
// happen _after_ onload: https://crbug.com/768961
this.sendCommand('Page.enable');
this.sendCommand('Emulation.setScriptExecutionDisabled', {value: disableJS});
this.sendCommand('Page.navigate', {url});
})
.then(_ => waitForLoad && this._waitForFullyLoaded(pauseAfterLoadMs,
networkQuietThresholdMs, cpuQuietThresholdMs, maxWaitMs))
.then(_ => this._endNetworkStatusMonitoring());
Expand Down

0 comments on commit 43e93bc

Please sign in to comment.