@mrporter/frontend-monitoring
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -40,2 +40,4 @@ 'use strict'; | ||
var _window$performance$t2 = window.performance.timing, | ||
navigationStart = _window$performance$t2.navigationStart, | ||
msFirstPaint = _window$performance$t2.msFirstPaint, | ||
domLoading = _window$performance$t2.domLoading, | ||
@@ -47,2 +49,13 @@ domInteractive = _window$performance$t2.domInteractive, | ||
var firstPaint = void 0; | ||
if (window.chrome && window.chrome.loadTimes) { | ||
var _window$chrome$loadTi = window.chrome.loadTimes(), | ||
firstPaintTime = _window$chrome$loadTi.firstPaintTime, | ||
startLoadTime = _window$chrome$loadTi.startLoadTime; | ||
firstPaint = Math.round((firstPaintTime - startLoadTime) * 1000); | ||
} else if (msFirstPaint) { | ||
firstPaint = msFirstPaint - navigationStart; | ||
} | ||
return { | ||
@@ -53,3 +66,4 @@ collection: 'page_performance', | ||
interactive: domInteractive - domLoading, | ||
content_loaded: domContentLoadedEventEnd - domLoading | ||
content_loaded: domContentLoadedEventEnd - domLoading, | ||
first_paint: firstPaint | ||
} | ||
@@ -56,0 +70,0 @@ }; |
{ | ||
"name": "@mrporter/frontend-monitoring", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Utils and Events for MRP front end monitoring", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
8082
137