-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(fr): option to skip about:blank jumps #13375
Conversation
I'm finding it really enjoyable when using the What are you thoughts on analysis of a trace with a single navigation in it -> treat it as if it were a navigation? Supporting that would unlock a few use cases:
It's possible it would also allow us to avoid adding parameters for every step, which makes it a lot harder to test everything (e.g. if you were to always Would it be helpful for us to set up some time to sketch out API shapes this week? I feel like it might be more concrete now that folks have experience with user flows vs 9 months ago when it was more hypothetical. Or do we have a new doc talking about goals and the APIs to meet them? I only know of the original design doc. |
I'm not sure about automatically converting a timespan to a navigation if there is a navigation event found. I would want to trigger navigations and timespans separately. What if the user ends the timespan before TTI? How do we know which gatherers to run if we don't know if we're in a timespan/navigation? It's possible, but also seems like a big refractor that would block one of our high-priority features. It's worth discussing some sort of
Is there any use case here not already covered by using a navigation followed by a timespan?
Yeah, SGTM. |
Yeah, good point, not automatically, you wouldn't want to accidentally switch from timespan to navigation modes just because there's a navigation in your timespan. I guess I meant more the ability to treat a timespan with a navigation in it as a navigation, at least for the metrics that are includable, starting at navStart instead of the beginning of the trace, etc. I'm not sure what the best approach for that would be, maybe an explicit fourth mode?
That's why I mentioned the DevTools trace processing integration, because we have the same problem there...did the trace taken by DevTools start early enough and last long enough to reliably take our metrics? etc.
yeah, this is probably an argument for a different mode or something
Definitely want to avoid a big refactor, which is an argument for adding to the API surface instead of changing existing stuff. I don't think the trace validation will be difficult. We more or less know our requirements, just some are currently encoded directly as checks on the trace (e.g. how we find the right navStart) while others we would need to write fresh (e.g. check that the trace ended with network quiet/cpu quiet just through trace events instead of from protocol/in-page events). But this is probably going too far down the path of thinking what's possible with artifacts instead of focusing on what's needed from the API first.
I think the main things are:
the answer to these also might not be a new mode, maybe it could be a higher level API that does the summarization of a navigation + timespan on behalf of the user or something |
Hi @adamraine ! Thank you very much for your work on this, User Flows are definitely awesome! I'm trying to use Basically, when we skip about:blank jumps on a page that has a registered event listener on "beforeunload" which performs a network request, an issue arise in PageDependencyGraph which throws an error "Root node was not in redirect chain of mainDocument". That's because the first request after we called flow.navigate is indeed the one made by the event listener and not the main document request as the code expects. I created a gist with code to reproduce (there is an express server along with a User Flow implementation, and the generated report so you don't have to run it by yourself): https://gist.github.com/Korrigan/0c631848d28af120dc4173b362b146a9 I've worked around it by dumbly replacing the rootNode instead of throwing in my test implementation but I would be happy to provide a better fix if I can, though I'm not sure about the correct approach yet since I haven't really looked at the code in PageDependencyGraph. By the way, I'll attempt a better |
Thanks for experimenting with this feature extremely early @Korrigan!
To be clear, we aren't even done designing this feature yet. The callback surface of That being said, there is a very experimental branch (we may scrap it eventually) with a workaround for the root node issue already: https://github.com/GoogleChrome/lighthouse/compare/fr-navigation-requestor. If you're truly interested in playing around with this right now, you can start there. |
Thanks for your advice @adamraine ! Your fr-navigation-requestor branch seems to be exactly what I need (I experimented with some very similar changes already), I'll hack around from there and see if I can make it work for my specific use case, which is far more simpler than what would be needed to make it work for all lighthouse users. |
Step 1 towards navigations triggered by user interactions (e.g.
flow.navigate(() => page.click('button'))
).Could enabled
about:blank
jumps for the first navigation like how we handledisableStorageReset
. I wanted to allow users to test a flow starting from another origin (e.g. clicking on the search result in google) without auditing that origin. That won't be possible if there areabout:blank
jumps on the first navigation, but I'm fine with either for now.#11313