const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
entry.attribution.forEach((attribution) => {
const json = attribution.toJSON();
console.log(json); // A plain object
console.log(typeof json); // "object"
console.log(json.containerType); // Same value as attribution.containerType
});
});
});
observer.observe({ type: "longtask", buffered: true });TaskAttributionTiming: toJSON() method / notebook
TaskAttributionTiming: toJSON() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
console.log(JSON.stringify(attribution));