Skip to content
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

Gathering trace data from iframe targets #15846

Closed
2 tasks done
rggammon opened this issue Feb 29, 2024 · 5 comments
Closed
2 tasks done

Gathering trace data from iframe targets #15846

rggammon opened this issue Feb 29, 2024 · 5 comments

Comments

@rggammon
Copy link

FAQ

URL

puppeteer/puppeteer#8991

What happened?

I am working with a site that uses cross-domain iframes, and notice that when I load a trace gathered by lighthouse into the devtools timeline/profiler viewer, I don't see data for the iframe. eg: js sample data, w/ #15542

What did you expect?

I'd like to see trace data for cross-domain iframes

What have you tried?

There is some discussion of this in puppeteer/puppeteer#8991

My hypothesis based on puppeteer/puppeteer#8991 would be that tracing needs to be enabled on these iframe targets as they are attached, similar to how Network.enable is being called per-session on attach -

await newSession.sendCommand('Network.enable');

And then, I think with flat protocol mode, traces for all the targets would have sessionId's and it is possible to merge all the trace events in one json file and devtools can load this combined file and show all frames in timeline/profile view.

How were you running Lighthouse?

node

Lighthouse Version

11.5.0

Chrome Version

No response

Node Version

No response

OS

Linux

Relevant log output

No response

@adamraine
Copy link
Member

I am seeing information for cross-origin iframes in traces collected by Lighthouse. For example:

https://trace.cafe/t/YgqEQVRVS9

This page contains several iframes and the data for each frame is present in the trace. I got the trace by running the following command:

lighthouse https://www.paulirish.com/2012/why-moving-elements-with-translate-is-better-than-posabs-topleft/ -G

Then I loaded latest-run/defaultPass.trace.json into a trace viewer (in this case trace.cafe but the DevTools performance panel is the same).

Maybe I'm misunderstanding something. What steps can I take to reproduce what you are seeing?

@rggammon
Copy link
Author

rggammon commented Mar 4, 2024

Thank you for the cli pointer - indeed it is working for me there. Here is a trace of paulirish.com with my setup where I don't see the iframes - https://trace.cafe/t/ZJoILNJNJX

Given that it is working with the cli, I should be able to compare my setup to this, and can report back with what the issue was.

@adamraine
Copy link
Member

adamraine commented Mar 4, 2024

@rggammon are you launching Chrome in old headless mode? I believe this was the default when using Puppeteer before Puppeteer v22.x.

In old headless mode, OOPIFs are disabled and so iframe thread activity will appear on the main thread.

If this is the case, using the new headless mode should be enough to fix the issue.

@rggammon
Copy link
Author

rggammon commented Mar 4, 2024

@adamraine I am actually launching chrome via playwright launchPersistentContext with headless: true - which is likely the issue. Thank you for the pointer! Will figure out how to get launchPersistentContext using new headless mode, and can post that here & resolve this

@rggammon
Copy link
Author

rggammon commented Mar 4, 2024

My issue wasn't with lighthouse but with how it is getting run -

Closing the bug, thank you again for the pointers!

@rggammon rggammon closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants