Executing JSON.stringify on a resource timing entry returns an empty object.

Issue #13522717 • Assigned to travil

Details

Created
Aug 30, 2017
Privacy
This issue is public.
Found in build #
40.15063
Reports
Reported by 1 person

Sign in to watch or report this issue.

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”

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “travil”

    You need to sign in to your Microsoft account to add a comment.

    Sign in