summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/selectors/index.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-03 17:44:55 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-03 17:44:55 +0100
commit8114b67b64e17482e46c2eaa77dd6a6156130dba (patch)
tree6bc5c58f4e642f3cbd139a5ef6216993e9a195e4 /devtools/client/netmonitor/selectors/index.js
parent28d03f81da77b3841180055d1b728d33a46d28ed (diff)
downloadUXP-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.js18
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,
};