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
Improve navigation #10
Comments
Today, 'page.navigate' waits for the |
example.com returns status 200 for all paths, so that non-existing-page case won't work. Is the idea to return false for non-200 status codes? I feel like the true/false should be whether or not the current page was rendered with data from that url. So 403/404/200 would be true, but timeout/brokenssl would be false. |
Rather than |
So the issue with returning How about:
This should address both @JoelEinbinder and @paulirish concerns. What do you guys think? |
it could return the fetch |
This patch adds a test to verify that navigation properly waits for the network to become idle. References #10
This patch: - Changes network idle promise to wait for 2 or fewer network requests for at least idleTime (defaults to 5s) before resolving. - Adds timer cleanup to failure navigation case. - Adds handling of webSocketClosed. - Ignores unrecognized requestIds to avoid negative inflight requests. References #10
Navigation is hard.
Make sure the following navigation scenarios work properly:
page.navigate('not-a-url')
should returnfalse
page.navigate('https://expired.badssl.com/')
should returnfalse
page.navigate('http://example.com/non-existing-page')
should returnfalse
page.navigate('http://example.com')
with no internet should returnfalse
page.navigate('data:text/html,hello')
should returntrue
window.location.href = 'http://example.com'
should be reported to puppeteer, probably via theNavigated
event.All of this should be also applicable to frame navigation in #4
The text was updated successfully, but these errors were encountered: