Skip to content

Commit

Permalink
less logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Feb 11, 2024
1 parent 16b99db commit 23a33bb
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/mixins/navigate.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,15 @@ async function checkPageIsReady () {
checkParams({appIdKey: this.appIdKey});

const readyCmd = 'document.readyState;';
let readyState = 'loading';
try {
readyState = await B.resolve(this.execute(readyCmd, true)).timeout(this.pageReadyTimeout);
return await B.resolve(this.execute(readyCmd, true)).timeout(this.pageReadyTimeout) === 'complete';
} catch (err) {
if (!(err instanceof B.TimeoutError)) {
throw err;
}
log.debug(`Page readiness check timed out after ${this.pageReadyTimeout}ms`);
return false;
}
log.debug(`Document readyState is '${readyState}'`);

return readyState === 'complete';
log.debug(`Page readiness check timed out after ${this.pageReadyTimeout}ms`);
return false;
}

/**
Expand Down

0 comments on commit 23a33bb

Please sign in to comment.