-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
feat: expose other sessions from connection #6863
Conversation
Jan and Maksim, could you PTAL and help Patrick with the tests? |
This approach creates a workaround for the OOPIF case, but from the other side, it would work only in headful chrome (headless doesn't kick frames out). FYI, there is a way to disable kicking out frame from process by using the launch flag |
Thanks for chiming in @sadym-chromium !
Yes and that's what we're trying to accomplish here. Lighthouse is attempting to migrate to using puppeteer and needs to support Network data from OOPIFs. We have two main cases in mind.
|
The PR is hacky, but serves its purpose. Please implement the tests and it's good to go IMO. |
bd50331
to
63f7a69
Compare
174c232
to
0a4ee91
Compare
Thanks @sadym-chromium for the pointer to the headful test file!
Is there a different API you'd prefer for exposing this information? I acknowledge what the consumer of this API has to do feels quite hacky, but this felt like a reasonable addition to the API surface for information that is currently impossible to obtain even though it can be requested via CDPSession already. |
0a4ee91
to
0d87516
Compare
Any advice for debugging the windows-only failure? Spin up a VM and try it myself? |
It's not immediately clear to me what might cause the test to fail on windows. Happy to try to reproduce it on windows tomorrow though :) |
I suspect event orders can cause it. Another unlikely reason can be in not having a frame kicked out for whatever reason, in which case special flag should be used. |
Thanks @jschfflr that would be much appreciated! Just a heads up team, I'll be away from code the next few weeks, so my progress may stall here temporarily, but not indicative of lower importance or interest :) |
I'm working on it. Just have to wait until my windows machine is provided. Currently I'm still missing some admin rights that I need in order to install nodejs. |
f321e93
to
3612cc5
Compare
Alright I'm back from leave and ready to work on this again, thanks for your patience :) Any advice for the Windows debugging? |
@patrickhulce I tried to reproduce the failing test on windows without success so far :/ |
Maybe you could add a temporary console log or something to see if the iframe got kicked out or if it's still in the same process. That way we could verify if we are having a problem with site isolation or if we should search somewhere else... |
Thanks for looking into it @jschfflr!
This means the test is passing for you as well, correct? I'll try to add some additional logging to find the source of the CI failure then 👍 |
Yes, it's passing on my windows machine. |
98af93b
to
1e8bff5
Compare
39e428d
to
20e67c5
Compare
Alright I've deflaked the Windows test and rebased against the other failures. I think we should be good here for final review :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me!
@patrickhulce Could you explain how you deflaked the test on windows? |
Sure! I noticed in the github actions logs that the iframe target and extra session were being emitted but just the network requests weren't being captured. There was nothing in the test that actually guaranteed the correct sequence of Experience on other projects' flaky tests and CI/Windows only clued me in that on that underpowered hardware you really need to be explicit about every wait condition, so I added a |
@patrickhulce Ah ok, thanks for sharing your experience! |
Anytime! What are the next steps to get this landed? Are there additional approvals needed? |
I think we are good here. I updated the branch and enabled auto merge so this should land shortly. |
This PR is aimed at providing mechanisms to allow puppeteer consumers to workaround OOPIF issues (see #2548). With this PR any consumer with a handle to a CDPSession should be able to find and listen to events from subtargets.
cc @mathiasbynens @jschfflr FYI
Example Script
Output