mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix(page): respect timeout 0 in page.waitForFunction (#2563)
The in-page task should not set timeout when timeout is 0. Fixes #2540.
This commit is contained in:
@@ -911,7 +911,8 @@ class WaitTask {
|
||||
async function waitForPredicatePageFunction(predicateBody, polling, timeout, ...args) {
|
||||
const predicate = new Function('...args', predicateBody);
|
||||
let timedOut = false;
|
||||
setTimeout(() => timedOut = true, timeout);
|
||||
if (timeout)
|
||||
setTimeout(() => timedOut = true, timeout);
|
||||
if (polling === 'raf')
|
||||
return await pollRaf();
|
||||
if (polling === 'mutation')
|
||||
|
||||
Reference in New Issue
Block a user