-
Couldn't load subscription status.
- Fork 27
Description
#202 has been open for a while, but we should really have an issue for larger discussion :)
The overall plan is roughly as specified in Cross-frame Performance Timeline, which is:
- An option to performance timeline APIs to request to include timeline events from child frames
- An opt-in which can be used by those child frame to allow sharing of timeline events with ancestor frames
- A
sourcereference on timeline entries which points to thewindowof the frame where they originated
The current concrete proposal for each of these is:
PerformanceObserverInitgains one new key:includeFrames. This is a boolean, defaulting to false, and can be used like this:
const observer = new PerformanceObserver(entryList => {/* callback */});
observer.observe({entryTypes: ["mark", "measure"],
includeFrames: true});
- We add a Document Policy configuration point,
share-performance-timeline-with, which takes a list of origins (possibly*) with which the framed document consents to share its timeline entries. Examples of its usage would look like:
Document-Policy: share-performance-timeline-with=*
Document-Policy: share-performance-timeline-with="https://example.com"
Document-Policy: share-performance-timeline-with=("https://example.com/", "https://embedder.com")- The
sourcemember ofPerformanceEntryrefers to thewindowof the frame in which the entry was generated.
It is an open question whether we want to, or can support this functionality on the synchronous timeline API methods getEntries, getEntriesByName and getEntriesByType. Because it requires cross-origin communication, this almost certainly would have to block while waiting for a response from child frames, possibly for a long time.
Those APIs may be useful, and are often easier to use than the PerformanceObserver API, but it may not be worth making them slower to support cross-origin frames. People who are writing new code to gather that data could just be encouraged to migrate to PerformanceObserver at the same time.