(function() {
  /**
   * Browsertime (http://www.browsertime.com)
   * Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
   * and other contributors
   * Released under the Apache 2.0 License
   */

// someway the get entries by type isn't working in IE using Selenium,
// will spend time fixing this later, now just return empty
  if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) {
    return [];
  }

  if (window.performance && window.performance.getEntriesByType) {
    var timings = window.performance.getEntriesByType('resource');
    // workaround for issue with Firefox where each resource timing entry contains a toJSON entry.
    return JSON.parse(JSON.stringify(timings));
  } else {
    return [];
  }
})();

(function() {
  if (window.performance && window.performance.getEntriesByType) {
    var timings = window.performance.getEntriesByType('resource');
    var resources = [];
    // we can do more cool stuff with resouce timing v2 in the
    // future
    timings.forEach(function(resource) {
        resources.push({
          name: resource.name,
          startTime: resource.startTime,
          duration: resource.duration
        });
    });

  return resources;
  } else {
    return [];
  }
})();

use the same pattern as user timings