From 8114b67b64e17482e46c2eaa77dd6a6156130dba Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sat, 3 Mar 2018 17:44:55 +0100 Subject: moebius#93: DevTools: Network - DOMContentLoaded and load Issue #31 Improvements: #34 https://github.com/MoonchildProductions/moebius/pull/93 --- devtools/client/netmonitor/selectors/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'devtools/client/netmonitor/selectors') diff --git a/devtools/client/netmonitor/selectors/index.js b/devtools/client/netmonitor/selectors/index.js index 60d6007cd..612188758 100644 --- a/devtools/client/netmonitor/selectors/index.js +++ b/devtools/client/netmonitor/selectors/index.js @@ -73,6 +73,24 @@ const getDisplayedRequestsSummary = createSelector( }) ); +function getDisplayedTimingMarker(state, marker) { + let timingMarker = null; + if (state.timingMarkers) { + timingMarker = state.timingMarkers.get(marker); + } + let firstRequestStartedMillis = null; + if (state.requests.items.length) { + firstRequestStartedMillis = state.requests.items[0] + .attachment.firstRequestStartedMillis; + } + if (timingMarker && firstRequestStartedMillis) { + return timingMarker - firstRequestStartedMillis; + } else { + return -1; + } +} + module.exports = { getDisplayedRequestsSummary, + getDisplayedTimingMarker, }; -- cgit v1.2.3