diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-03 17:44:55 +0100 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-03 17:44:55 +0100 |
commit | 8114b67b64e17482e46c2eaa77dd6a6156130dba (patch) | |
tree | 6bc5c58f4e642f3cbd139a5ef6216993e9a195e4 /devtools/client/netmonitor/selectors/index.js | |
parent | 28d03f81da77b3841180055d1b728d33a46d28ed (diff) | |
download | UXP-8114b67b64e17482e46c2eaa77dd6a6156130dba.tar UXP-8114b67b64e17482e46c2eaa77dd6a6156130dba.tar.gz UXP-8114b67b64e17482e46c2eaa77dd6a6156130dba.tar.lz UXP-8114b67b64e17482e46c2eaa77dd6a6156130dba.tar.xz UXP-8114b67b64e17482e46c2eaa77dd6a6156130dba.zip |
moebius#93: DevTools: Network - DOMContentLoaded and load
Issue #31
Improvements: #34
https://github.com/MoonchildProductions/moebius/pull/93
Diffstat (limited to 'devtools/client/netmonitor/selectors/index.js')
-rw-r--r-- | devtools/client/netmonitor/selectors/index.js | 18 |
1 files changed, 18 insertions, 0 deletions
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, }; |