mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Rename 'maxTime' option of Page.navigate into 'timeout'
The motivation behind this rename is to name all the 'timeout' options across methods similarly. References #39.
This commit is contained in:
@@ -25,7 +25,7 @@ class NavigatorWatcher {
|
||||
constructor(client, networkManager, options = {}) {
|
||||
this._client = client;
|
||||
this._networkManager = networkManager;
|
||||
this._maxTime = typeof options['maxTime'] === 'number' ? options['maxTime'] : 30000;
|
||||
this._timeout = typeof options['timeout'] === 'number' ? options['timeout'] : 30000;
|
||||
this._idleTime = typeof options['networkIdleTimeout'] === 'number' ? options['networkIdleTimeout'] : 1000;
|
||||
this._idleInflight = typeof options['networkIdleInflight'] === 'number' ? options['networkIdleInflight'] : 2;
|
||||
this._waitUntil = typeof options['waitUntil'] === 'string' ? options['waitUntil'] : 'load';
|
||||
@@ -43,7 +43,7 @@ class NavigatorWatcher {
|
||||
.then(error => new Error('SSL Certiciate error: ' + error.errorType));
|
||||
let networkIdle = new Promise(fulfill => this._networkIdleCallback = fulfill).then(() => null);
|
||||
let loadEventFired = new Promise(fulfill => this._client.once('Page.loadEventFired', fulfill)).then(() => null);
|
||||
let watchdog = new Promise(fulfill => this._maximumTimer = setTimeout(fulfill, this._maxTime)).then(() => new Error('Navigation Timeout Exceeded: ' + this._maxTime + 'ms exceeded'));
|
||||
let watchdog = new Promise(fulfill => this._maximumTimer = setTimeout(fulfill, this._timeout)).then(() => new Error('Navigation Timeout Exceeded: ' + this._timeout + 'ms exceeded'));
|
||||
|
||||
try {
|
||||
// Await for the command to throw exception in case of illegal arguments.
|
||||
|
||||
Reference in New Issue
Block a user