ebidel / appmetrics.js

A small (< 1kb) library for measuring things in your web app and reporting the results to Google Analytics.
Apache License 2.0
1.37k stars 67 forks source link

Fix performance-support check #5

Closed dpuscher closed 7 years ago

dpuscher commented 7 years ago

I realized that the check if a browser supports the performance object fails (e.g. in Safari 7: ReferenceError: Can't find variable: performance). If checking explicitly the presence of performance on the window object this should be fail-safe.

ebidel commented 7 years ago

I'd like to keep this working for worker contexts. Can you use self instead of window?

dpuscher commented 7 years ago

Sure, I updated my commit.