New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: expose page.on('networkidle0') and page.on('networkidle2') events #3083
Comments
A few notes for anyone else impatient for these first-class events. The can be emulated link above is useful if you need different idleness parameters (# of requests, ms of time). Alternatively, if you want a basic page._client.on('Page.lifecycleEvent', e => {
// networkidle0 => 'networkIdle', networkidle2 => 'networkAlmostIdle'
if (e.name === 'networkIdle') fn()
}); Standard disclaimers about using the protocol directly (this may break unexpectedly) apply. |
@paulirish the lifecycle events are per frame, so the hacky way doesn't really work |
This patch adds a new method - `Page.ensureNavigation` - that completes once the last running navigation hits the conditions defined in `waitUntil` clause. This comes handy when awaiting loading of a pages spawned as a result of ctrl-click and other events. References puppeteer#3083
Any updates on this? |
I opened this PR which should help with this. |
This has been requested quite a few times on the bugtracker already.
As a workaround, network idleness can be emulated on the puppeteer-side.
The text was updated successfully, but these errors were encountered: