mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
feat(page): add an option to disable timeout for waitForFunction (#2252)
This patch adds support for `timeout: 0` to disable timeout for the following functions: - `page.waitForFunction` - `page.waitForXPath` - `page.waitForSelector` and their `frame` counterparts. Fixes #2200
This commit is contained in:
committed by
Andrey Lushnikov
parent
71a07bb50c
commit
abb05e069d
@@ -790,7 +790,8 @@ class WaitTask {
|
||||
});
|
||||
// Since page navigation requires us to re-install the pageScript, we should track
|
||||
// timeout on our end.
|
||||
this._timeoutTimer = setTimeout(() => this.terminate(new Error(`waiting failed: timeout ${timeout}ms exceeded`)), timeout);
|
||||
if (timeout)
|
||||
this._timeoutTimer = setTimeout(() => this.terminate(new Error(`waiting failed: timeout ${timeout}ms exceeded`)), timeout);
|
||||
this.rerun();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user