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
Capture tracing information for all iframes #8991
Comments
@goelayu yes, I believe CDP clients have to enable tracing per target, i.e., frame or page and I am not sure if there is a workaround. |
@OrKoN This might be orthogonal to this issue, but could you elaborate why Also, if that is indeed the case, is this something that could be added in the future versions of this library, for consistency reasons? |
@goelayu not sure, maybe it works because it's happening in the network process. In general, the difficulty here is to merge different trace files together on Puppeteer side or make https://chromedevtools.github.io/devtools-protocol/tot/Tracing/#method-start cross-target. |
@OrKoN So I tried the above described approach, and turns out the CDP client for each frame To start tracing on each frame, I would need a way to create a CDP Session for each frame. |
There are two kinds of iframes: same-process and out-of-process. If the client is the same as the page client, it means the iframe is local and lives in the same renderer. In general, I would expect tracing to work for local iframes but not for out-of-process iframes. How do you determine that events are only captured for the main frame? The code starting the tracing is here https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/tracing_handler.cc;l=826;drc=f97e7e130b02a0fee5a06aa9cdf25d3a0a3715d0 but I am not 100% sure about the scope of tracing. |
@OrKoN Thanks for the clarification. One follow-up question: Regarding how I determine that events are only captured for the main frame, I upload the file to Chrome's Performance tab, and only a single frame's trace is displayed. |
It seems work only when headless mode is disabled by default,And I find out it is about “Site Isolation”. Add --site-per-process to make it work in headless mode .
|
related to #2548 |
By default,
page.tracing
only captures the trace logs for the main frame. However, in Chrome's GUI when you capture the trace information, it by default captures it for all frames.Is there a way to do the same programmatically?
The only way I can think of, is as follows:
frameattached
event, get access to every frame on the pageframe._client
API since it doesn't directly export thepage
object corresponding to each frame.Despite the above round about way, each frame will have its own trace file, as opposed to a single trace file containing information for all frames.
The text was updated successfully, but these errors were encountered: