Executing JSON.stringify on a resource timing entry returns an empty object.
Issue #13522717 • Assigned to travil
Steps to reproduce
Summary
Executing JSON.stringify on a resource timing entry returns an empty object.
Snippet:
JSON.stringify(window.performance.getEntriesByType("resource")[0]);
Expected:
I expect to see a string of the form: "{"name":"https://ssl.gstatic.com/chrome/components/doodle-notifier-02.html","entryType":"resource","startTime":409.295,"duration":7.160000000000025,"initiatorType":"link","nextHopProtocol":"hq","workerStart":409.94500000000005,"redirectStart":0,"redirectEnd":0,"fetchStart":409.94500000000005,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"secureConnectionStart":0,"requestStart":0,"responseStart":0,"responseEnd":416.45500000000004,"transferSize":0,"encodedBodySize":0,"decodedBodySize":0,"serverTiming":[]}"
Actual:
Returns string with an empty object: "{}"
Initial investigation:
It seems like the timing properties are being stored on the prototype of the object, hence do not get returned from JSON.stringify. Also the toJSON method does not seem to exist on the entry returned. Running just window.performance.getEntriesByType("resource")[0].toJSON()
throws an error “Object does not support property or method called toJSON”
You need to sign in to your Microsoft account to add a comment.
Sign in