-
Notifications
You must be signed in to change notification settings - Fork 27
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
"bubbles" flag for monitoring of all IFRAMEs #86
Comments
The use case is compelling and makes sense. There are some implementation gotchas we need to think through...
|
|
Sorry, I was wrong about the first point. These fields are defined here. Adding some subset of these to PerformanceEntry would be a plausible approach. |
As a starting point, I like LongTasks's
Yeah it seems like getting notifications for everything up and down the chain would be helpful. As long as I can distinguish where it came from (i.e. LongTask's
|
Why just
Nic, what's a concrete use case for this? Is it common for analytics to embedded inside a same-origin iframe, and then harvest data from parent frame? What about |
Oh, I want them all still! "containerType etc". I've found that each is used in different cases, i.e. some third parties only set the src while others will also set an id/name that is easier to associate with the third-party.
That's how Boomerang is loaded today, though we basically "break out" of the same-origin iframe and do all of our work (e.g. register the PerfObserver) in/to the root frame anyways.
I don't have a strong opinion here, since we (and I feel like other analytics scripts) would most likely register their PO in the root frame if possible (and would expect to see entries for all same-origin descendants). |
Ok, so it sounds like we'd then want to lift the ~container attribute definitions "all the way" into PerformanceEntry..
I'm still a bit skeptical on the "global" bit. If we stick with "bubbles up", I think the use case you outlined at the start is fulfilled. Moving to "global" opens up another axis of complexity: we need to signal direction (descendant, ancestor, self, same-origin), and my intuition is that we don't want to enable Observers to collect entries across windows that share event loop -- e.g. multiple same-origin top-level tabs open by the user? /cc @spanicker |
My current proposal for this is outlined in this doc, and adds an "includeFrames" flag for the caller of Spec change for review at #202 |
I just went through the documents and proposals around this, and I feel like we're missing a big piece which is workers (mainly service workers, but not only). Those could have their own entries, which would not be included in the iframe timeline, thus giving a partial picture when relying on this to understand the impact of a particular 3rd party. |
I'd like to discuss a method for registering a PerformanceObserver that would notify me of the observable entries from all (same-origin) frames on the page, from the root frame plus all (same-origin) descendants (children, grand-children, etc).
The motivation for this is that we'd like to be able to monitor the complete picture of events happening on the page (as an example, ResourceTiming entries), in every frame, without having to register a PerformanceObserver in all of those frames.
With today's PerformanceObserver, if we want to monitor all frames, at startup, we'll register PO for the root frame, then traverse the
frame.frames
tree to access all same-origin frames, registering POs there as well. Once we've done that, we'll have to translate events from any descendant frame's time-origin to the root frame's time origin.After doing the above, what about new IFRAMEs that get added to the page dynamically? We'd either have to register a MutationObserver to listen in all of these frames just to be notified of any new frames (ugh! talk about observer effect!), or crawl the frame tree later (at beacon time) to see which ones didn't have a PO registered, and hope their buffers hadn't been filled up.
Instead, I'd love to get a
bubbles: true
flag (there's probably a better name) available during PO registration:If set, this would:
(note, LongTasks already kind of does this, as it notifies you of entries happening in same- and cross-origin frames).
The text was updated successfully, but these errors were encountered: