Puppeteer: Setting a different default timeout for `waitForFunction`

Created on 25 Oct 2017  路  1Comment  路  Source: puppeteer/puppeteer

I'd like to set a different default timeout for page.waitForFunction.

https://github.com/GoogleChrome/puppeteer/blob/ab9b34cd5dad54e170be916016a4e9b4097231ed/lib/FrameManager.js#L461

Currently, I'm monkey patching the page.waitForFunction to set a different default timeout of 5000.

Any ideas on how to do this in a better way?

Most helpful comment

I'd use a default options object and pass it over everywhere.

Other than that, your approach seems reasonable to me.

>All comments

I'd use a default options object and pass it over everywhere.

Other than that, your approach seems reasonable to me.

Was this page helpful?
0 / 5 - 0 ratings