Open clelland opened 2 years ago
I think this is still missing a piece -- PerformanceObservers shouldn't always get events from child frames; that needs to be conditional on PerformanceObserverInit.includeFrames.
Additionally, the way this is written may cause the finite buffers to overflow quickly; I should find a way to avoid that
This seems generally reasonable. May be good to share this with the WG, and see what folks think of the general shape
WG is generally supportive (discussed at the 2022-11-10 meeting)
One question was brought up about feature detection, and how developers could know whether cross-frame entries are supported at all, if we just use a boolean parameter on getEntries*
.
After some consideration, I think that developers should be able to detect the presence of this feature by looking for the source
property on the PerformanceEntry
interface; something like
Object.getOwnPropertyNames(PerformanceEntry.prototype).indexOf('source') != -1
Another thing I didn't see here or in the design document is reference to to timeOrigin
. Entries from different frames are going to be of different time origins and thus out of sync. I guess we could have the time origin as a property in each cross-frame entry? Would that be ergonomic?
This adds a Document-Policy configuration point for documents, named "share-performance-timeline-with", which acceps a set of origins. If it is non-empty, then ancestor frames whose origins are contained in that set can access the timeline entries of the child frame, either through a PerformanceObserver, or by passing a boolean flag into the various getEntries methods.
Preview | Diff