Looks like window.performance.getEntries
and window.performance.getEntriesByType
are not defined in Safari.
Is there a polyfill for those functions? Or did someone created sort of alternative?
What I want to do is to get all resources loaded in the page. (all images, css and js files)
Due to Safari does not provide that information in any JavaScript way, it's impossible to create a Polyfill for that. Stop looking for it. You are not going to have luck with it :(
PS.: Be careful with this answer. Some functions on window.performance
can be implemented with polyfills, but not the 2 that I asked for (which are necessary for some performance checks)
Safari does implement performance.timing; The metrics are in epoch time
> performance.timing
< PerformanceTiming = $2
connectEnd: 1588977207613
connectStart: 1588977207613
domComplete: 1588977208988
domContentLoadedEventEnd: 1588977208410
domContentLoadedEventStart: 1588977208390
domInteractive: 1588977208390
domLoading: 1588977207819
domainLookupEnd: 1588977207613
domainLookupStart: 1588977207613
fetchStart: 1588977207613
loadEventEnd: 1588977209012
loadEventStart: 1588977209012
navigationStart: 1588977207613
redirectEnd: 0
redirectStart: 0
requestStart: 1588977207685
responseEnd: 1588977207826
responseStart: 1588977207804
secureConnectionStart: 0
unloadEventEnd: 0
unloadEventStart: 0
PerformanceTiming Prototype
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With