@cloudcare/browser-rum 3.0.29 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +3 -2
- package/cjs/boot/buildEnv.js.map +1 -0
- package/cjs/boot/recorderApi.js +5 -25
- package/cjs/boot/recorderApi.js.map +1 -0
- package/cjs/boot/rum.entry.js +2 -7
- package/cjs/boot/rum.entry.js.map +1 -0
- package/cjs/boot/rum.js +40 -43
- package/cjs/boot/rum.js.map +1 -0
- package/cjs/boot/rumPublicApi.js +3 -49
- package/cjs/boot/rumPublicApi.js.map +1 -0
- package/cjs/boot/startRecording.js +2 -9
- package/cjs/boot/startRecording.js.map +1 -0
- package/cjs/constants.js +8 -6
- package/cjs/constants.js.map +1 -0
- package/cjs/domain/assembly.js +8 -20
- package/cjs/domain/assembly.js.map +1 -0
- package/cjs/domain/configuration.js +15 -52
- package/cjs/domain/configuration.js.map +1 -0
- package/cjs/domain/contexts/commonContext.js +2 -2
- package/cjs/domain/contexts/commonContext.js.map +1 -0
- package/cjs/domain/contexts/displayContext.js +28 -0
- package/cjs/domain/contexts/displayContext.js.map +1 -0
- package/cjs/domain/contexts/foregroundContexts.js +4 -29
- package/cjs/domain/contexts/foregroundContexts.js.map +1 -0
- package/cjs/domain/contexts/internalContext.js +5 -4
- package/cjs/domain/contexts/internalContext.js.map +1 -0
- package/cjs/domain/contexts/pageStateHistory.js +106 -0
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -0
- package/cjs/domain/contexts/urlContexts.js +3 -9
- package/cjs/domain/contexts/urlContexts.js.map +1 -0
- package/cjs/domain/contexts/viewContexts.js +2 -6
- package/cjs/domain/contexts/viewContexts.js.map +1 -0
- package/cjs/domain/domMutationCollection.js +6 -10
- package/cjs/domain/domMutationCollection.js.map +1 -0
- package/cjs/domain/initViewportObservable.js +4 -11
- package/cjs/domain/initViewportObservable.js.map +1 -0
- package/cjs/domain/locationChangeObservable.js +2 -11
- package/cjs/domain/locationChangeObservable.js.map +1 -0
- package/cjs/domain/performanceCollection.js +11 -39
- package/cjs/domain/performanceCollection.js.map +1 -0
- package/cjs/domain/replay/record/elementsScrollPositions.js +2 -3
- package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -0
- package/cjs/domain/replay/record/index.js +2 -4
- package/cjs/domain/replay/record/index.js.map +1 -0
- package/cjs/domain/replay/record/mutationBatch.js +4 -11
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -0
- package/cjs/domain/replay/record/mutationObserver.js +27 -86
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -0
- package/cjs/domain/replay/record/observers.js +15 -89
- package/cjs/domain/replay/record/observers.js.map +1 -0
- package/cjs/domain/replay/record/privacy.js +57 -75
- package/cjs/domain/replay/record/privacy.js.map +1 -0
- package/cjs/domain/replay/record/record.js +6 -29
- package/cjs/domain/replay/record/record.js.map +1 -0
- package/cjs/domain/replay/record/serializationUtils.js +8 -68
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -0
- package/cjs/domain/replay/record/serialize.js +43 -118
- package/cjs/domain/replay/record/serialize.js.map +1 -0
- package/cjs/domain/replay/record/shadowRootsController.js +4 -11
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -0
- package/cjs/domain/replay/record/utils.js +4 -12
- package/cjs/domain/replay/record/utils.js.map +1 -0
- package/cjs/domain/replay/record/viewports.js +4 -42
- package/cjs/domain/replay/record/viewports.js.map +1 -0
- package/cjs/domain/replay/replayStats.js +2 -14
- package/cjs/domain/replay/replayStats.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js +3 -8
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/index.js +2 -3
- package/cjs/domain/replay/segmentCollection/index.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/segment.js +7 -23
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +5 -24
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/startDeflateWorker.js +5 -24
- package/cjs/domain/replay/segmentCollection/startDeflateWorker.js.map +1 -0
- package/cjs/domain/requestCollection.js +2 -17
- package/cjs/domain/requestCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js +12 -22
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/clickChain.js +3 -14
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js +12 -20
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js +22 -53
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js +13 -45
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js +4 -6
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -0
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js +15 -45
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -0
- package/cjs/domain/rumEventsCollection/error/errorCollection.js +13 -23
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js +2 -3
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -0
- package/cjs/domain/rumEventsCollection/error/trackReportError.js +4 -5
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -0
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -7
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/matchRequestTiming.js +2 -13
- package/cjs/domain/rumEventsCollection/resource/matchRequestTiming.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +2 -18
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -0
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +58 -69
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js +55 -0
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js +62 -0
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +74 -0
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +26 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js +2 -8
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstInputTimings.js +38 -0
- package/cjs/domain/rumEventsCollection/view/trackFirstInputTimings.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js +26 -179
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +120 -0
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +49 -0
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js +39 -0
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js +37 -0
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js +61 -0
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js +3 -6
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackViews.js +26 -58
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/viewCollection.js +43 -48
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -0
- package/cjs/domain/rumSessionManager.js +3 -13
- package/cjs/domain/rumSessionManager.js.map +1 -0
- package/cjs/domain/tracing/ddtraceTracer.js +2 -4
- package/cjs/domain/tracing/ddtraceTracer.js.map +1 -0
- package/cjs/domain/tracing/getDocumentTraceId.js +5 -22
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/cjs/domain/tracing/jaegerTracer.js +2 -4
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -0
- package/cjs/domain/tracing/skywalkingTracer.js +6 -13
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -0
- package/cjs/domain/tracing/traceIdentifier.js +2 -7
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -0
- package/cjs/domain/tracing/tracer.js +5 -30
- package/cjs/domain/tracing/tracer.js.map +1 -0
- package/cjs/domain/tracing/w3cTraceParentTracer.js +2 -11
- package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -0
- package/cjs/domain/tracing/zipkinMultiTracer.js +4 -6
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -0
- package/cjs/domain/tracing/zipkinSingleTracer.js +2 -4
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -0
- package/cjs/domain/trackEventCounts.js +2 -10
- package/cjs/domain/trackEventCounts.js.map +1 -0
- package/cjs/domain/usr/index.js +2 -7
- package/cjs/domain/usr/index.js.map +1 -0
- package/cjs/domain/waitPageActivityEnd.js +7 -23
- package/cjs/domain/waitPageActivityEnd.js.map +1 -0
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -0
- package/cjs/transport/startRumBatch.js +7 -8
- package/cjs/transport/startRumBatch.js.map +1 -0
- package/cjs/transport/startRumEventBridge.js +2 -3
- package/cjs/transport/startRumEventBridge.js.map +1 -0
- package/cjs/types/index.js +2 -3
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/sessionReplayConstants.js +4 -3
- package/cjs/types/sessionReplayConstants.js.map +1 -0
- package/esm/boot/buildEnv.js +3 -2
- package/esm/boot/buildEnv.js.map +1 -0
- package/esm/boot/recorderApi.js +5 -19
- package/esm/boot/recorderApi.js.map +1 -0
- package/esm/boot/rum.entry.js +2 -1
- package/esm/boot/rum.entry.js.map +1 -0
- package/esm/boot/rum.js +41 -23
- package/esm/boot/rum.js.map +1 -0
- package/esm/boot/rumPublicApi.js +3 -43
- package/esm/boot/rumPublicApi.js.map +1 -0
- package/esm/boot/startRecording.js +2 -4
- package/esm/boot/startRecording.js.map +1 -0
- package/esm/constants.js +8 -4
- package/esm/constants.js.map +1 -0
- package/esm/domain/assembly.js +8 -17
- package/esm/domain/assembly.js.map +1 -0
- package/esm/domain/configuration.js +15 -38
- package/esm/domain/configuration.js.map +1 -0
- package/esm/domain/contexts/commonContext.js +2 -1
- package/esm/domain/contexts/commonContext.js.map +1 -0
- package/esm/domain/contexts/displayContext.js +21 -0
- package/esm/domain/contexts/displayContext.js.map +1 -0
- package/esm/domain/contexts/foregroundContexts.js +6 -25
- package/esm/domain/contexts/foregroundContexts.js.map +1 -0
- package/esm/domain/contexts/internalContext.js +5 -3
- package/esm/domain/contexts/internalContext.js.map +1 -0
- package/esm/domain/contexts/pageStateHistory.js +96 -0
- package/esm/domain/contexts/pageStateHistory.js.map +1 -0
- package/esm/domain/contexts/urlContexts.js +3 -6
- package/esm/domain/contexts/urlContexts.js.map +1 -0
- package/esm/domain/contexts/viewContexts.js +2 -3
- package/esm/domain/contexts/viewContexts.js.map +1 -0
- package/esm/domain/domMutationCollection.js +6 -7
- package/esm/domain/domMutationCollection.js.map +1 -0
- package/esm/domain/initViewportObservable.js +4 -6
- package/esm/domain/initViewportObservable.js.map +1 -0
- package/esm/domain/locationChangeObservable.js +2 -9
- package/esm/domain/locationChangeObservable.js.map +1 -0
- package/esm/domain/performanceCollection.js +11 -35
- package/esm/domain/performanceCollection.js.map +1 -0
- package/esm/domain/replay/record/elementsScrollPositions.js +2 -2
- package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -0
- package/esm/domain/replay/record/index.js +2 -1
- package/esm/domain/replay/record/index.js.map +1 -0
- package/esm/domain/replay/record/mutationBatch.js +5 -9
- package/esm/domain/replay/record/mutationBatch.js.map +1 -0
- package/esm/domain/replay/record/mutationObserver.js +29 -80
- package/esm/domain/replay/record/mutationObserver.js.map +1 -0
- package/esm/domain/replay/record/observers.js +15 -72
- package/esm/domain/replay/record/observers.js.map +1 -0
- package/esm/domain/replay/record/privacy.js +57 -65
- package/esm/domain/replay/record/privacy.js.map +1 -0
- package/esm/domain/replay/record/record.js +6 -19
- package/esm/domain/replay/record/record.js.map +1 -0
- package/esm/domain/replay/record/serializationUtils.js +8 -46
- package/esm/domain/replay/record/serializationUtils.js.map +1 -0
- package/esm/domain/replay/record/serialize.js +45 -107
- package/esm/domain/replay/record/serialize.js.map +1 -0
- package/esm/domain/replay/record/shadowRootsController.js +4 -6
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -0
- package/esm/domain/replay/record/utils.js +4 -6
- package/esm/domain/replay/record/utils.js.map +1 -0
- package/esm/domain/replay/record/viewports.js +3 -32
- package/esm/domain/replay/record/viewports.js.map +1 -0
- package/esm/domain/replay/replayStats.js +2 -8
- package/esm/domain/replay/replayStats.js.map +1 -0
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js +3 -5
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
- package/esm/domain/replay/segmentCollection/index.js +2 -1
- package/esm/domain/replay/segmentCollection/index.js.map +1 -0
- package/esm/domain/replay/segmentCollection/segment.js +4 -12
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -0
- package/esm/domain/replay/segmentCollection/segmentCollection.js +4 -13
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -0
- package/esm/domain/replay/segmentCollection/startDeflateWorker.js +5 -16
- package/esm/domain/replay/segmentCollection/startDeflateWorker.js.map +1 -0
- package/esm/domain/requestCollection.js +2 -10
- package/esm/domain/requestCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/actionCollection.js +12 -19
- package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/clickChain.js +3 -10
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js +12 -14
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js +22 -50
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js +12 -40
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js +4 -4
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -0
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js +18 -37
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -0
- package/esm/domain/rumEventsCollection/error/errorCollection.js +14 -19
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js +2 -1
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -0
- package/esm/domain/rumEventsCollection/error/trackReportError.js +4 -3
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -0
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -5
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/matchRequestTiming.js +3 -11
- package/esm/domain/rumEventsCollection/resource/matchRequestTiming.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +2 -13
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -0
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js +58 -57
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js +47 -0
- package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js +56 -0
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +67 -0
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +18 -0
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js +2 -4
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackFirstInputTimings.js +32 -0
- package/esm/domain/rumEventsCollection/view/trackFirstInputTimings.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js +25 -164
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +113 -0
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +41 -0
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js +33 -0
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js +31 -0
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js +53 -0
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js +5 -3
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackViews.js +28 -54
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/viewCollection.js +43 -44
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -0
- package/esm/domain/rumSessionManager.js +3 -9
- package/esm/domain/rumSessionManager.js.map +1 -0
- package/esm/domain/tracing/ddtraceTracer.js +2 -2
- package/esm/domain/tracing/ddtraceTracer.js.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.js +5 -15
- package/esm/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/esm/domain/tracing/jaegerTracer.js +3 -2
- package/esm/domain/tracing/jaegerTracer.js.map +1 -0
- package/esm/domain/tracing/skywalkingTracer.js +8 -12
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -0
- package/esm/domain/tracing/traceIdentifier.js +2 -4
- package/esm/domain/tracing/traceIdentifier.js.map +1 -0
- package/esm/domain/tracing/tracer.js +5 -19
- package/esm/domain/tracing/tracer.js.map +1 -0
- package/esm/domain/tracing/w3cTraceParentTracer.js +4 -8
- package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -0
- package/esm/domain/tracing/zipkinMultiTracer.js +5 -4
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -0
- package/esm/domain/tracing/zipkinSingleTracer.js +3 -2
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -0
- package/esm/domain/trackEventCounts.js +2 -8
- package/esm/domain/trackEventCounts.js.map +1 -0
- package/esm/domain/usr/index.js +2 -3
- package/esm/domain/usr/index.js.map +1 -0
- package/esm/domain/waitPageActivityEnd.js +9 -19
- package/esm/domain/waitPageActivityEnd.js.map +1 -0
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -0
- package/esm/transport/startRumBatch.js +7 -6
- package/esm/transport/startRumBatch.js.map +1 -0
- package/esm/transport/startRumEventBridge.js +2 -1
- package/esm/transport/startRumEventBridge.js.map +1 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/sessionReplayConstants.js +5 -3
- package/esm/types/sessionReplayConstants.js.map +1 -0
- package/package.json +6 -5
- package/src/boot/rum.js +45 -10
- package/src/domain/assembly.js +5 -2
- package/src/domain/configuration.js +0 -1
- package/src/domain/contexts/displayContext.js +29 -0
- package/src/domain/contexts/internalContext.js +3 -1
- package/src/domain/contexts/pageStateHistory.js +139 -0
- package/src/domain/replay/record/mutationObserver.js +2 -1
- package/src/domain/replay/record/observers.js +3 -3
- package/src/domain/replay/record/privacy.js +20 -23
- package/src/domain/replay/record/record.js +2 -2
- package/src/domain/replay/record/serializationUtils.js +4 -2
- package/src/domain/replay/record/serialize.js +11 -14
- package/src/domain/replay/record/shadowRootsController.js +0 -1
- package/src/domain/replay/record/viewports.js +0 -26
- package/src/domain/rumEventsCollection/actions/actionCollection.js +12 -12
- package/src/domain/rumEventsCollection/actions/trackClickActions.js +8 -6
- package/src/domain/rumEventsCollection/error/errorCollection.js +20 -15
- package/src/domain/rumEventsCollection/error/trackReportError.js +22 -16
- package/src/domain/rumEventsCollection/view/interactionCountPolyfill.js +59 -0
- package/src/domain/rumEventsCollection/view/trackCommonViewMetrics.js +87 -0
- package/src/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +73 -0
- package/src/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +23 -0
- package/src/domain/rumEventsCollection/view/trackFirstInputTimings.js +40 -0
- package/src/domain/rumEventsCollection/view/trackInitialViewTimings.js +29 -199
- package/src/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +144 -0
- package/src/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +57 -0
- package/src/domain/rumEventsCollection/view/trackLoadingTime.js +50 -0
- package/src/domain/rumEventsCollection/view/trackNavigationTimings.js +35 -0
- package/src/domain/rumEventsCollection/view/trackScrollMetrics.js +74 -0
- package/src/domain/rumEventsCollection/view/trackViews.js +32 -37
- package/src/domain/rumEventsCollection/view/viewCollection.js +51 -22
- package/src/transport/startRumBatch.js +5 -1
- package/cjs/domain/rumEventsCollection/view/trackViewMetrics.js +0 -156
- package/esm/domain/rumEventsCollection/view/trackViewMetrics.js +0 -146
- package/src/domain/rumEventsCollection/view/trackViewMetrics.js +0 -176
|
@@ -7,40 +7,32 @@ exports.retrieveInitialDocumentResourceTiming = retrieveInitialDocumentResourceT
|
|
|
7
7
|
exports.startPerformanceCollection = startPerformanceCollection;
|
|
8
8
|
exports.supportPerformanceEntry = supportPerformanceEntry;
|
|
9
9
|
exports.supportPerformanceTimingEvent = supportPerformanceTimingEvent;
|
|
10
|
-
|
|
11
10
|
var _browserCore = require("@cloudcare/browser-core");
|
|
12
|
-
|
|
13
11
|
var _resourceUtils = require("./rumEventsCollection/resource/resourceUtils");
|
|
14
|
-
|
|
15
12
|
function supportPerformanceObject() {
|
|
16
13
|
return window.performance !== undefined && 'getEntries' in performance;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
function supportPerformanceTimingEvent(entryType) {
|
|
20
16
|
return window.PerformanceObserver && PerformanceObserver.supportedEntryTypes !== undefined && (0, _browserCore.includes)(PerformanceObserver.supportedEntryTypes, entryType);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
function startPerformanceCollection(lifeCycle, configuration) {
|
|
24
19
|
retrieveInitialDocumentResourceTiming(function (timing) {
|
|
25
20
|
handleRumPerformanceEntries(lifeCycle, configuration, [timing]);
|
|
26
21
|
});
|
|
27
|
-
|
|
28
22
|
if (supportPerformanceObject()) {
|
|
29
|
-
var performanceEntries = performance.getEntries();
|
|
23
|
+
var performanceEntries = performance.getEntries();
|
|
24
|
+
// Because the performance entry list can be quite large
|
|
30
25
|
// delay the computation to prevent the SDK from blocking the main thread on init
|
|
31
|
-
|
|
32
26
|
(0, _browserCore.setTimeout)(function () {
|
|
33
27
|
handleRumPerformanceEntries(lifeCycle, configuration, performanceEntries);
|
|
34
28
|
});
|
|
35
29
|
}
|
|
36
|
-
|
|
37
30
|
if (window.PerformanceObserver) {
|
|
38
31
|
var handlePerformanceEntryList = (0, _browserCore.monitor)(function (entries) {
|
|
39
32
|
handleRumPerformanceEntries(lifeCycle, configuration, entries.getEntries());
|
|
40
33
|
});
|
|
41
34
|
var mainEntries = ['resource', 'navigation', 'longtask', 'paint'];
|
|
42
35
|
var experimentalEntries = ['largest-contentful-paint', 'first-input', 'layout-shift'];
|
|
43
|
-
|
|
44
36
|
try {
|
|
45
37
|
// Experimental entries are not retrieved by performance.getEntries()
|
|
46
38
|
// use a single PerformanceObserver with buffered flag by type
|
|
@@ -59,12 +51,10 @@ function startPerformanceCollection(lifeCycle, configuration) {
|
|
|
59
51
|
mainEntries.push(type);
|
|
60
52
|
});
|
|
61
53
|
}
|
|
62
|
-
|
|
63
54
|
var mainObserver = new PerformanceObserver(handlePerformanceEntryList);
|
|
64
55
|
mainObserver.observe({
|
|
65
56
|
entryTypes: mainEntries
|
|
66
57
|
});
|
|
67
|
-
|
|
68
58
|
if (supportPerformanceObject() && 'addEventListener' in performance) {
|
|
69
59
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1559377
|
|
70
60
|
(0, _browserCore.addEventListener)(performance, 'resourcetimingbufferfull', function () {
|
|
@@ -72,20 +62,17 @@ function startPerformanceCollection(lifeCycle, configuration) {
|
|
|
72
62
|
});
|
|
73
63
|
}
|
|
74
64
|
}
|
|
75
|
-
|
|
76
65
|
if (!supportPerformanceTimingEvent('navigation')) {
|
|
77
66
|
retrieveNavigationTiming(function (timing) {
|
|
78
67
|
handleRumPerformanceEntries(lifeCycle, configuration, [timing]);
|
|
79
68
|
});
|
|
80
69
|
}
|
|
81
|
-
|
|
82
70
|
if (!supportPerformanceTimingEvent('first-input')) {
|
|
83
71
|
retrieveFirstInputTiming(function (timing) {
|
|
84
72
|
return handleRumPerformanceEntries(lifeCycle, configuration, [timing]);
|
|
85
73
|
});
|
|
86
74
|
}
|
|
87
75
|
}
|
|
88
|
-
|
|
89
76
|
function retrieveInitialDocumentResourceTiming(callback) {
|
|
90
77
|
(0, _browserCore.runOnReadyState)('interactive', function () {
|
|
91
78
|
var timing;
|
|
@@ -94,7 +81,6 @@ function retrieveInitialDocumentResourceTiming(callback) {
|
|
|
94
81
|
initiatorType: _resourceUtils.FAKE_INITIAL_DOCUMENT,
|
|
95
82
|
traceId: ''
|
|
96
83
|
};
|
|
97
|
-
|
|
98
84
|
if (supportPerformanceTimingEvent('navigation') && performance.getEntriesByType('navigation').length > 0) {
|
|
99
85
|
var navigationEntry = performance.getEntriesByType('navigation')[0];
|
|
100
86
|
timing = (0, _browserCore.extend)(navigationEntry.toJSON(), forcedAttributes);
|
|
@@ -107,29 +93,25 @@ function retrieveInitialDocumentResourceTiming(callback) {
|
|
|
107
93
|
startTime: 0
|
|
108
94
|
}, forcedAttributes);
|
|
109
95
|
}
|
|
110
|
-
|
|
111
96
|
callback(timing);
|
|
112
97
|
});
|
|
113
98
|
}
|
|
114
|
-
|
|
115
99
|
function retrieveNavigationTiming(callback) {
|
|
116
100
|
function sendFakeTiming() {
|
|
117
101
|
callback((0, _browserCore.extend)(computeRelativePerformanceTiming(), {
|
|
118
102
|
entryType: 'navigation'
|
|
119
103
|
}));
|
|
120
104
|
}
|
|
121
|
-
|
|
122
105
|
(0, _browserCore.runOnReadyState)('complete', function () {
|
|
123
106
|
// Send it a bit after the actual load event, so the "loadEventEnd" timing is accurate
|
|
124
107
|
(0, _browserCore.setTimeout)(sendFakeTiming);
|
|
125
108
|
});
|
|
126
109
|
}
|
|
110
|
+
|
|
127
111
|
/**
|
|
128
112
|
* first-input timing entry polyfill based on
|
|
129
113
|
* https://github.com/GoogleChrome/web-vitals/blob/master/src/lib/polyfills/firstInputPolyfill.ts
|
|
130
114
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
115
|
function retrieveFirstInputTiming(callback) {
|
|
134
116
|
var startTimeStamp = (0, _browserCore.dateNow)();
|
|
135
117
|
var timingSent = false;
|
|
@@ -137,17 +119,16 @@ function retrieveFirstInputTiming(callback) {
|
|
|
137
119
|
// Only count cancelable events, which should trigger behavior important to the user.
|
|
138
120
|
if (!evt.cancelable) {
|
|
139
121
|
return;
|
|
140
|
-
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// This timing will be used to compute the "first Input delay", which is the delta between
|
|
141
125
|
// when the system received the event (e.g. evt.timeStamp) and when it could run the callback
|
|
142
126
|
// (e.g. performance.now()).
|
|
143
|
-
|
|
144
|
-
|
|
145
127
|
var timing = {
|
|
146
128
|
entryType: 'first-input',
|
|
147
129
|
processingStart: (0, _browserCore.relativeNow)(),
|
|
148
130
|
startTime: evt.timeStamp
|
|
149
131
|
};
|
|
150
|
-
|
|
151
132
|
if (evt.type === _browserCore.DOM_EVENT.POINTER_DOWN) {
|
|
152
133
|
sendTimingIfPointerIsNotCancelled(timing);
|
|
153
134
|
} else {
|
|
@@ -158,13 +139,13 @@ function retrieveFirstInputTiming(callback) {
|
|
|
158
139
|
capture: true
|
|
159
140
|
});
|
|
160
141
|
var removeEventListeners = listeners.stop;
|
|
142
|
+
|
|
161
143
|
/**
|
|
162
144
|
* Pointer events are a special case, because they can trigger main or compositor thread behavior.
|
|
163
145
|
* We differenciate these cases based on whether or not we see a pointercancel event, which are
|
|
164
146
|
* fired when we scroll. If we're scrolling we don't need to report input delay since FID excludes
|
|
165
147
|
* scrolling and pinch/zooming.
|
|
166
148
|
*/
|
|
167
|
-
|
|
168
149
|
function sendTimingIfPointerIsNotCancelled(timing) {
|
|
169
150
|
(0, _browserCore.addEventListeners)(window, [_browserCore.DOM_EVENT.POINTER_UP, _browserCore.DOM_EVENT.POINTER_CANCEL], function (event) {
|
|
170
151
|
if (event.type === _browserCore.DOM_EVENT.POINTER_UP) {
|
|
@@ -174,38 +155,32 @@ function retrieveFirstInputTiming(callback) {
|
|
|
174
155
|
once: true
|
|
175
156
|
});
|
|
176
157
|
}
|
|
177
|
-
|
|
178
158
|
function sendTiming(timing) {
|
|
179
159
|
if (!timingSent) {
|
|
180
160
|
timingSent = true;
|
|
181
|
-
removeEventListeners();
|
|
161
|
+
removeEventListeners();
|
|
162
|
+
// In some cases the recorded delay is clearly wrong, e.g. it's negative or it's larger than
|
|
182
163
|
// the time between now and when the page was loaded.
|
|
183
164
|
// - https://github.com/GoogleChromeLabs/first-input-delay/issues/4
|
|
184
165
|
// - https://github.com/GoogleChromeLabs/first-input-delay/issues/6
|
|
185
166
|
// - https://github.com/GoogleChromeLabs/first-input-delay/issues/7
|
|
186
|
-
|
|
187
167
|
var delay = timing.processingStart - timing.startTime;
|
|
188
|
-
|
|
189
168
|
if (delay >= 0 && delay < (0, _browserCore.dateNow)() - startTimeStamp) {
|
|
190
169
|
callback(timing);
|
|
191
170
|
}
|
|
192
171
|
}
|
|
193
172
|
}
|
|
194
173
|
}
|
|
195
|
-
|
|
196
174
|
function computeRelativePerformanceTiming() {
|
|
197
175
|
var result = {};
|
|
198
176
|
var timing = performance.timing;
|
|
199
|
-
|
|
200
177
|
for (var key in timing) {
|
|
201
178
|
if ((0, _browserCore.isNumber)(timing[key])) {
|
|
202
179
|
result[key] = timing[key] === 0 ? 0 : (0, _browserCore.getRelativeTime)(timing[key]);
|
|
203
180
|
}
|
|
204
181
|
}
|
|
205
|
-
|
|
206
182
|
return result;
|
|
207
183
|
}
|
|
208
|
-
|
|
209
184
|
function handleRumPerformanceEntries(lifeCycle, configuration, entries) {
|
|
210
185
|
var rumPerformanceEntries = (0, _browserCore.filter)(entries, function (entry) {
|
|
211
186
|
return entry.entryType === 'resource' || entry.entryType === 'navigation' || entry.entryType === 'paint' || entry.entryType === 'longtask' || entry.entryType === 'largest-contentful-paint' || entry.entryType === 'first-input' || entry.entryType === 'layout-shift';
|
|
@@ -213,21 +188,18 @@ function handleRumPerformanceEntries(lifeCycle, configuration, entries) {
|
|
|
213
188
|
var rumAllowedPerformanceEntries = (0, _browserCore.filter)(rumPerformanceEntries, function (entry) {
|
|
214
189
|
return !isIncompleteNavigation(entry) && !isForbiddenResource(configuration, entry);
|
|
215
190
|
});
|
|
216
|
-
|
|
217
191
|
if (rumAllowedPerformanceEntries.length) {
|
|
218
192
|
lifeCycle.notify(_browserCore.LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED, rumAllowedPerformanceEntries);
|
|
219
193
|
}
|
|
220
194
|
}
|
|
221
|
-
|
|
222
195
|
function isIncompleteNavigation(entry) {
|
|
223
196
|
return entry.entryType === 'navigation' && entry.loadEventEnd <= 0;
|
|
224
197
|
}
|
|
225
|
-
|
|
226
198
|
function isForbiddenResource(configuration, entry) {
|
|
227
199
|
return entry.entryType === 'resource' && !(0, _resourceUtils.isAllowedRequestUrl)(configuration, entry.name);
|
|
228
200
|
}
|
|
229
|
-
|
|
230
201
|
function supportPerformanceEntry() {
|
|
231
202
|
// Safari 10 doesn't support PerformanceEntry
|
|
232
203
|
return typeof PerformanceEntry === 'function';
|
|
233
|
-
}
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=performanceCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performanceCollection.js","names":["_browserCore","require","_resourceUtils","supportPerformanceObject","window","performance","undefined","supportPerformanceTimingEvent","entryType","PerformanceObserver","supportedEntryTypes","includes","startPerformanceCollection","lifeCycle","configuration","retrieveInitialDocumentResourceTiming","timing","handleRumPerformanceEntries","performanceEntries","getEntries","setTimeout","handlePerformanceEntryList","monitor","entries","mainEntries","experimentalEntries","each","type","observer","observe","buffered","e","push","mainObserver","entryTypes","addEventListener","clearResourceTimings","retrieveNavigationTiming","retrieveFirstInputTiming","callback","runOnReadyState","forcedAttributes","initiatorType","FAKE_INITIAL_DOCUMENT","traceId","getEntriesByType","length","navigationEntry","extend","toJSON","relativePerformanceTiming","computeRelativePerformanceTiming","decodedBodySize","duration","responseEnd","name","location","href","startTime","sendFakeTiming","startTimeStamp","dateNow","timingSent","listeners","addEventListeners","DOM_EVENT","CLICK","MOUSE_DOWN","KEY_DOWN","TOUCH_START","POINTER_DOWN","evt","cancelable","processingStart","relativeNow","timeStamp","sendTimingIfPointerIsNotCancelled","sendTiming","passive","capture","removeEventListeners","stop","POINTER_UP","POINTER_CANCEL","event","once","delay","result","key","isNumber","getRelativeTime","rumPerformanceEntries","filter","entry","rumAllowedPerformanceEntries","isIncompleteNavigation","isForbiddenResource","notify","LifeCycleEventType","PERFORMANCE_ENTRIES_COLLECTED","loadEventEnd","isAllowedRequestUrl","supportPerformanceEntry","PerformanceEntry"],"sources":["../../src/domain/performanceCollection.js"],"sourcesContent":["import {\n addEventListeners,\n getRelativeTime,\n isNumber,\n includes,\n each,\n extend,\n filter,\n dateNow,\n relativeNow,\n DOM_EVENT,\n LifeCycleEventType,\n runOnReadyState,\n setTimeout,\n addEventListener,\n monitor\n} from '@cloudcare/browser-core'\nimport {\n FAKE_INITIAL_DOCUMENT,\n isAllowedRequestUrl\n} from './rumEventsCollection/resource/resourceUtils'\nfunction supportPerformanceObject() {\n return window.performance !== undefined && 'getEntries' in performance\n}\n\nexport function supportPerformanceTimingEvent(entryType) {\n return (\n window.PerformanceObserver &&\n PerformanceObserver.supportedEntryTypes !== undefined &&\n includes(PerformanceObserver.supportedEntryTypes, entryType)\n )\n}\nexport function startPerformanceCollection(lifeCycle, configuration) {\n retrieveInitialDocumentResourceTiming(function (timing) {\n handleRumPerformanceEntries(lifeCycle, configuration, [timing])\n })\n\n if (supportPerformanceObject()) {\n var performanceEntries = performance.getEntries()\n // Because the performance entry list can be quite large\n // delay the computation to prevent the SDK from blocking the main thread on init\n setTimeout(function () {\n handleRumPerformanceEntries(lifeCycle, configuration, performanceEntries)\n })\n }\n if (window.PerformanceObserver) {\n var handlePerformanceEntryList = monitor(function (entries) {\n handleRumPerformanceEntries(\n lifeCycle,\n configuration,\n entries.getEntries()\n )\n })\n var mainEntries = ['resource', 'navigation', 'longtask', 'paint']\n var experimentalEntries = [\n 'largest-contentful-paint',\n 'first-input',\n 'layout-shift'\n ]\n try {\n // Experimental entries are not retrieved by performance.getEntries()\n // use a single PerformanceObserver with buffered flag by type\n // to get values that could happen before SDK init\n each(experimentalEntries, function (type) {\n var observer = new PerformanceObserver(handlePerformanceEntryList)\n observer.observe({ type: type, buffered: true })\n })\n } catch (e) {\n // Some old browser versions (ex: chrome 67) don't support the PerformanceObserver type and buffered options\n // In these cases, fallback to PerformanceObserver with entryTypes\n each(experimentalEntries, function (type) {\n mainEntries.push(type)\n })\n }\n var mainObserver = new PerformanceObserver(handlePerformanceEntryList)\n mainObserver.observe({ entryTypes: mainEntries })\n if (supportPerformanceObject() && 'addEventListener' in performance) {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377\n addEventListener(performance, 'resourcetimingbufferfull', function () {\n performance.clearResourceTimings()\n })\n }\n }\n if (!supportPerformanceTimingEvent('navigation')) {\n retrieveNavigationTiming(function (timing) {\n handleRumPerformanceEntries(lifeCycle, configuration, [timing])\n })\n }\n if (!supportPerformanceTimingEvent('first-input')) {\n retrieveFirstInputTiming(function (timing) {\n return handleRumPerformanceEntries(lifeCycle, configuration, [timing])\n })\n }\n}\n\nexport function retrieveInitialDocumentResourceTiming(callback) {\n runOnReadyState('interactive', function () {\n var timing\n\n var forcedAttributes = {\n entryType: 'resource',\n initiatorType: FAKE_INITIAL_DOCUMENT,\n traceId: ''\n }\n if (\n supportPerformanceTimingEvent('navigation') &&\n performance.getEntriesByType('navigation').length > 0\n ) {\n var navigationEntry = performance.getEntriesByType('navigation')[0]\n timing = extend(navigationEntry.toJSON(), forcedAttributes)\n } else {\n var relativePerformanceTiming = computeRelativePerformanceTiming()\n timing = extend(\n relativePerformanceTiming,\n {\n decodedBodySize: 0,\n duration: relativePerformanceTiming.responseEnd,\n name: window.location.href,\n startTime: 0\n },\n forcedAttributes\n )\n }\n callback(timing)\n })\n}\n\nfunction retrieveNavigationTiming(callback) {\n function sendFakeTiming() {\n callback(\n extend(computeRelativePerformanceTiming(), { entryType: 'navigation' })\n )\n }\n\n runOnReadyState('complete', function () {\n // Send it a bit after the actual load event, so the \"loadEventEnd\" timing is accurate\n setTimeout(sendFakeTiming)\n })\n}\n\n/**\n * first-input timing entry polyfill based on\n * https://github.com/GoogleChrome/web-vitals/blob/master/src/lib/polyfills/firstInputPolyfill.ts\n */\nfunction retrieveFirstInputTiming(callback) {\n var startTimeStamp = dateNow()\n var timingSent = false\n\n var listeners = addEventListeners(\n window,\n [\n DOM_EVENT.CLICK,\n DOM_EVENT.MOUSE_DOWN,\n DOM_EVENT.KEY_DOWN,\n DOM_EVENT.TOUCH_START,\n DOM_EVENT.POINTER_DOWN\n ],\n function (evt) {\n // Only count cancelable events, which should trigger behavior important to the user.\n if (!evt.cancelable) {\n return\n }\n\n // This timing will be used to compute the \"first Input delay\", which is the delta between\n // when the system received the event (e.g. evt.timeStamp) and when it could run the callback\n // (e.g. performance.now()).\n var timing = {\n entryType: 'first-input',\n processingStart: relativeNow(),\n startTime: evt.timeStamp\n }\n\n if (evt.type === DOM_EVENT.POINTER_DOWN) {\n sendTimingIfPointerIsNotCancelled(timing)\n } else {\n sendTiming(timing)\n }\n },\n { passive: true, capture: true }\n )\n var removeEventListeners = listeners.stop\n\n /**\n * Pointer events are a special case, because they can trigger main or compositor thread behavior.\n * We differenciate these cases based on whether or not we see a pointercancel event, which are\n * fired when we scroll. If we're scrolling we don't need to report input delay since FID excludes\n * scrolling and pinch/zooming.\n */\n function sendTimingIfPointerIsNotCancelled(timing) {\n addEventListeners(\n window,\n [DOM_EVENT.POINTER_UP, DOM_EVENT.POINTER_CANCEL],\n function (event) {\n if (event.type === DOM_EVENT.POINTER_UP) {\n sendTiming(timing)\n }\n },\n { once: true }\n )\n }\n\n function sendTiming(timing) {\n if (!timingSent) {\n timingSent = true\n removeEventListeners()\n // In some cases the recorded delay is clearly wrong, e.g. it's negative or it's larger than\n // the time between now and when the page was loaded.\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/4\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/6\n // - https://github.com/GoogleChromeLabs/first-input-delay/issues/7\n var delay = timing.processingStart - timing.startTime\n if (delay >= 0 && delay < dateNow() - startTimeStamp) {\n callback(timing)\n }\n }\n }\n}\n\nfunction computeRelativePerformanceTiming() {\n var result = {}\n var timing = performance.timing\n for (var key in timing) {\n if (isNumber(timing[key])) {\n result[key] = timing[key] === 0 ? 0 : getRelativeTime(timing[key])\n }\n }\n return result\n}\n\nfunction handleRumPerformanceEntries(lifeCycle, configuration, entries) {\n var rumPerformanceEntries = filter(entries, function (entry) {\n return (\n entry.entryType === 'resource' ||\n entry.entryType === 'navigation' ||\n entry.entryType === 'paint' ||\n entry.entryType === 'longtask' ||\n entry.entryType === 'largest-contentful-paint' ||\n entry.entryType === 'first-input' ||\n entry.entryType === 'layout-shift'\n )\n })\n\n var rumAllowedPerformanceEntries = filter(\n rumPerformanceEntries,\n function (entry) {\n return (\n !isIncompleteNavigation(entry) &&\n !isForbiddenResource(configuration, entry)\n )\n }\n )\n\n if (rumAllowedPerformanceEntries.length) {\n lifeCycle.notify(\n LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED,\n rumAllowedPerformanceEntries\n )\n }\n}\n\nfunction isIncompleteNavigation(entry) {\n return entry.entryType === 'navigation' && entry.loadEventEnd <= 0\n}\n\nfunction isForbiddenResource(configuration, entry) {\n return (\n entry.entryType === 'resource' &&\n !isAllowedRequestUrl(configuration, entry.name)\n )\n}\nexport function supportPerformanceEntry() {\n // Safari 10 does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CAACE,sBAAsB,CAACF,KAAK,CAAC,IAC9B,CAACG,mBAAmB,CAAClF,aAAa,EAAE+E,KAAK,CAAC;EAE9C,CACF,CAAC;EAED,IAAIC,4BAA4B,CAAChD,MAAM,EAAE;IACvCjC,SAAS,CAACoF,MAAM,CACdC,+BAAkB,CAACC,6BAA6B,EAChDL,4BACF,CAAC;EACH;AACF;AAEA,SAASC,sBAAsBA,CAACF,KAAK,EAAE;EACrC,OAAOA,KAAK,CAACrF,SAAS,KAAK,YAAY,IAAIqF,KAAK,CAACO,YAAY,IAAI,CAAC;AACpE;AAEA,SAASJ,mBAAmBA,CAAClF,aAAa,EAAE+E,KAAK,EAAE;EACjD,OACEA,KAAK,CAACrF,SAAS,KAAK,UAAU,IAC9B,CAAC,IAAA6F,kCAAmB,EAACvF,aAAa,EAAE+E,KAAK,CAACtC,IAAI,CAAC;AAEnD;AACO,SAAS+C,uBAAuBA,CAAA,EAAG;EACxC;EACA,OAAO,OAAOC,gBAAgB,KAAK,UAAU;AAC/C"}
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createElementsScrollPositions = createElementsScrollPositions;
|
|
7
|
-
|
|
8
7
|
function createElementsScrollPositions() {
|
|
9
8
|
var scrollPositionsByElement = new WeakMap();
|
|
10
9
|
return {
|
|
@@ -14,7 +13,6 @@ function createElementsScrollPositions() {
|
|
|
14
13
|
// in some cases scrolling elements can not be defined, we don't support those for now
|
|
15
14
|
return;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
scrollPositionsByElement.set(element === document ? document.scrollingElement : element, scrollPositions);
|
|
19
17
|
},
|
|
20
18
|
get: function get(element) {
|
|
@@ -24,4 +22,5 @@ function createElementsScrollPositions() {
|
|
|
24
22
|
return scrollPositionsByElement.has(element);
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
|
-
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=elementsScrollPositions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementsScrollPositions.js","names":["createElementsScrollPositions","scrollPositionsByElement","WeakMap","set","element","scrollPositions","document","scrollingElement","get","has"],"sources":["../../../../src/domain/replay/record/elementsScrollPositions.js"],"sourcesContent":["export function createElementsScrollPositions() {\n var scrollPositionsByElement = new WeakMap()\n return {\n set: function (element, scrollPositions) {\n if (element === document && !document.scrollingElement) {\n // cf https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement,\n // in some cases scrolling elements can not be defined, we don't support those for now\n return\n }\n scrollPositionsByElement.set(\n element === document ? document.scrollingElement : element,\n scrollPositions\n )\n },\n get: function (element) {\n return scrollPositionsByElement.get(element)\n },\n has: function (element) {\n return scrollPositionsByElement.has(element)\n }\n }\n}\n"],"mappings":";;;;;;AAAO,SAASA,6BAA6BA,CAAA,EAAG;EAC9C,IAAIC,wBAAwB,GAAG,IAAIC,OAAO,CAAC,CAAC;EAC5C,OAAO;IACLC,GAAG,EAAE,SAAAA,IAAUC,OAAO,EAAEC,eAAe,EAAE;MACvC,IAAID,OAAO,KAAKE,QAAQ,IAAI,CAACA,QAAQ,CAACC,gBAAgB,EAAE;QACtD;QACA;QACA;MACF;MACAN,wBAAwB,CAACE,GAAG,CAC1BC,OAAO,KAAKE,QAAQ,GAAGA,QAAQ,CAACC,gBAAgB,GAAGH,OAAO,EAC1DC,eACF,CAAC;IACH,CAAC;IACDG,GAAG,EAAE,SAAAA,IAAUJ,OAAO,EAAE;MACtB,OAAOH,wBAAwB,CAACO,GAAG,CAACJ,OAAO,CAAC;IAC9C,CAAC;IACDK,GAAG,EAAE,SAAAA,IAAUL,OAAO,EAAE;MACtB,OAAOH,wBAAwB,CAACQ,GAAG,CAACL,OAAO,CAAC;IAC9C;EACF,CAAC;AACH"}
|
|
@@ -33,9 +33,7 @@ Object.defineProperty(exports, "serializeNodeWithId", {
|
|
|
33
33
|
return _serialize.serializeNodeWithId;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
|
|
37
36
|
var _record = require("./record");
|
|
38
|
-
|
|
39
37
|
var _serialize = require("./serialize");
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
var _elementsScrollPositions = require("./elementsScrollPositions");
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_record","require","_serialize","_elementsScrollPositions"],"sources":["../../../../src/domain/replay/record/index.js"],"sourcesContent":["export { record } from './record'\nexport {\n serializeNodeWithId,\n serializeDocument,\n SerializationContextStatus\n} from './serialize'\nexport { createElementsScrollPositions } from './elementsScrollPositions'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAKA,IAAAE,wBAAA,GAAAF,OAAA"}
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createMutationBatch = createMutationBatch;
|
|
7
|
-
|
|
8
7
|
var _browserCore = require("@cloudcare/browser-core");
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* Maximum duration to wait before processing mutations. If the browser is idle, mutations will be
|
|
12
10
|
* processed more quickly. If the browser is busy executing small tasks (ex: rendering frames), the
|
|
@@ -14,26 +12,22 @@ var _browserCore = require("@cloudcare/browser-core");
|
|
|
14
12
|
* browser is busy executing a longer task, mutations will be processed after this task.
|
|
15
13
|
*/
|
|
16
14
|
var MUTATION_PROCESS_MAX_DELAY = 100;
|
|
17
|
-
|
|
18
15
|
function createMutationBatch(processMutationBatch) {
|
|
19
16
|
var cancelScheduledFlush = _browserCore.noop;
|
|
20
17
|
var pendingMutations = [];
|
|
21
|
-
|
|
22
18
|
function flush() {
|
|
23
19
|
cancelScheduledFlush();
|
|
24
20
|
processMutationBatch(pendingMutations);
|
|
25
21
|
pendingMutations = [];
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
return {
|
|
29
24
|
addMutations: function addMutations(mutations) {
|
|
30
25
|
if (pendingMutations.length === 0) {
|
|
31
26
|
cancelScheduledFlush = requestIdleCallback(flush, {
|
|
32
27
|
timeout: MUTATION_PROCESS_MAX_DELAY
|
|
33
28
|
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
}
|
|
30
|
+
// pendingMutations.push(...mutations)
|
|
37
31
|
Array.prototype.push.apply(pendingMutations, mutations);
|
|
38
32
|
},
|
|
39
33
|
flush: flush,
|
|
@@ -42,7 +36,6 @@ function createMutationBatch(processMutationBatch) {
|
|
|
42
36
|
}
|
|
43
37
|
};
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
function requestIdleCallback(callback, opts) {
|
|
47
40
|
// Use 'requestIdleCallback' when available: it will throttle the mutation processing if the
|
|
48
41
|
// browser is busy rendering frames (ex: when frames are below 60fps). When not available, the
|
|
@@ -55,9 +48,9 @@ function requestIdleCallback(callback, opts) {
|
|
|
55
48
|
return window.cancelIdleCallback(id);
|
|
56
49
|
};
|
|
57
50
|
}
|
|
58
|
-
|
|
59
51
|
var id = window.requestAnimationFrame((0, _browserCore.monitor)(callback));
|
|
60
52
|
return function () {
|
|
61
53
|
return window.cancelAnimationFrame(id);
|
|
62
54
|
};
|
|
63
|
-
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=mutationBatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutationBatch.js","names":["_browserCore","require","MUTATION_PROCESS_MAX_DELAY","createMutationBatch","processMutationBatch","cancelScheduledFlush","noop","pendingMutations","flush","addMutations","mutations","length","requestIdleCallback","timeout","Array","prototype","push","apply","stop","callback","opts","window","id","monitor","cancelIdleCallback","requestAnimationFrame","cancelAnimationFrame"],"sources":["../../../../src/domain/replay/record/mutationBatch.js"],"sourcesContent":["import { noop, monitor } from '@cloudcare/browser-core'\n\n/**\n * Maximum duration to wait before processing mutations. If the browser is idle, mutations will be\n * processed more quickly. If the browser is busy executing small tasks (ex: rendering frames), the\n * mutations will wait MUTATION_PROCESS_MAX_DELAY milliseconds before being processed. If the\n * browser is busy executing a longer task, mutations will be processed after this task.\n */\nvar MUTATION_PROCESS_MAX_DELAY = 100\n\nexport function createMutationBatch(processMutationBatch) {\n var cancelScheduledFlush = noop\n var pendingMutations = []\n\n function flush() {\n cancelScheduledFlush()\n processMutationBatch(pendingMutations)\n pendingMutations = []\n }\n\n return {\n addMutations: function (mutations) {\n if (pendingMutations.length === 0) {\n cancelScheduledFlush = requestIdleCallback(flush, {\n timeout: MUTATION_PROCESS_MAX_DELAY\n })\n }\n // pendingMutations.push(...mutations)\n Array.prototype.push.apply(pendingMutations, mutations)\n },\n\n flush: flush,\n\n stop: function () {\n cancelScheduledFlush()\n }\n }\n}\n\nfunction requestIdleCallback(callback, opts) {\n // Use 'requestIdleCallback' when available: it will throttle the mutation processing if the\n // browser is busy rendering frames (ex: when frames are below 60fps). When not available, the\n // fallback on 'requestAnimationFrame' will still ensure the mutations are processed after any\n // browser rendering process (Layout, Recalculate Style, etc.), so we can serialize DOM nodes\n // efficiently.\n if (window.requestIdleCallback) {\n var id = window.requestIdleCallback(monitor(callback), opts)\n return function () {\n return window.cancelIdleCallback(id)\n }\n }\n var id = window.requestAnimationFrame(monitor(callback))\n return function () {\n return window.cancelAnimationFrame(id)\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,0BAA0B,GAAG,GAAG;AAE7B,SAASC,mBAAmBA,CAACC,oBAAoB,EAAE;EACxD,IAAIC,oBAAoB,GAAGC,iBAAI;EAC/B,IAAIC,gBAAgB,GAAG,EAAE;EAEzB,SAASC,KAAKA,CAAA,EAAG;IACfH,oBAAoB,CAAC,CAAC;IACtBD,oBAAoB,CAACG,gBAAgB,CAAC;IACtCA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