mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(page): Allow Page.goto's timeout to be 0 to disable timeout (#887)
This patch allows passing 0 to disable timeout for the following methods: - page.goto - page.waitForNavigation - page.goForward - page.goBack Fixes #782.
This commit is contained in:
committed by
Andrey Lushnikov
parent
bafd937fc3
commit
53531c9a92
@@ -40,9 +40,12 @@ class NavigatorWatcher {
|
||||
|
||||
this._eventListeners = [];
|
||||
|
||||
const watchdog = new Promise(fulfill => this._maximumTimer = setTimeout(fulfill, this._timeout))
|
||||
.then(() => 'Navigation Timeout Exceeded: ' + this._timeout + 'ms exceeded');
|
||||
const navigationPromises = [watchdog];
|
||||
const navigationPromises = [];
|
||||
if (this._timeout) {
|
||||
const watchdog = new Promise(fulfill => this._maximumTimer = setTimeout(fulfill, this._timeout))
|
||||
.then(() => 'Navigation Timeout Exceeded: ' + this._timeout + 'ms exceeded');
|
||||
navigationPromises.push(watchdog);
|
||||
}
|
||||
|
||||
if (!this._ignoreHTTPSErrors) {
|
||||
const certificateError = new Promise(fulfill => {
|
||||
|
||||
Reference in New Issue
Block a user