lib/grover/js/processor.js in grover-1.0.1 vs lib/grover/js/processor.js in grover-1.0.2
- old
+ new
@@ -182,9 +182,16 @@
const waitForSelectorOptions = options.waitForSelectorOptions; delete options.waitForSelectorOptions;
if (waitForSelector !== undefined) {
await page.waitForSelector(waitForSelector, waitForSelectorOptions);
}
+ // If specified, wait for function
+ const waitForFunction = options.waitForFunction; delete options.waitForFunction;
+ const waitForFunctionOptions = options.waitForFunctionOptions; delete options.waitForFunctionOptions;
+ if (waitForFunction !== undefined) {
+ await page.waitForFunction(waitForFunction, waitForFunctionOptions);
+ }
+
// If specified, wait for timeout
const waitForTimeout = options.waitForTimeout; delete options.waitForTimeout;
if (waitForTimeout !== undefined) {
await page.waitForTimeout(waitForTimeout);
}