addyosmani / timing.js

Navigation Timing API measurement helpers
1.5k stars 114 forks source link

iOS 8.1 removed window.performance (Navigation Timing API) and has error when loading this library #9

Closed forty4 closed 9 years ago

forty4 commented 9 years ago

iOS 8.1 removed window.performance (Navigation Timing API)

In the code, 'performance' is undefined and the web app stops.

var performance = window.performance || window.webkitPerformance || window.msPerformance || window.mozPerformance;
var timing = performance.timing;

It is necessary to check if performance is not undefined before executing the library code.

igrigorik commented 9 years ago

"The Navigation Timing API has been disabled only on iOS due to performance issues." [1]

</facepalm>

[1] https://developer.apple.com/Library/ios/releasenotes/Miscellaneous/RN-iOSSDK-8.1/index.html

addyosmani commented 9 years ago

Ugh. That's unfortunate :/