@cloudcare/browser-rum 3.0.29 → 3.1.1
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 +30 -46
- 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 +7 -11
- 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 +105 -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/deflate/deflateEncoder.js +82 -0
- package/cjs/domain/replay/deflate/deflateEncoder.js.map +1 -0
- package/cjs/domain/replay/deflate/deflateWorker.js +142 -0
- package/cjs/domain/replay/deflate/deflateWorker.js.map +1 -0
- package/cjs/domain/replay/deflate/index.js +44 -0
- package/cjs/domain/replay/deflate/index.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 +4 -9
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/index.js +1 -9
- package/cjs/domain/replay/segmentCollection/index.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/segment.js +23 -87
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -0
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +41 -64
- package/cjs/domain/replay/segmentCollection/segmentCollection.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 +32 -42
- 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 +8 -7
- 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 +95 -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/deflate/deflateEncoder.js +74 -0
- package/esm/domain/replay/deflate/deflateEncoder.js.map +1 -0
- package/esm/domain/replay/deflate/deflateWorker.js +129 -0
- package/esm/domain/replay/deflate/deflateWorker.js.map +1 -0
- package/esm/domain/replay/deflate/index.js +3 -0
- package/esm/domain/replay/deflate/index.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 +4 -6
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -0
- package/esm/domain/replay/segmentCollection/index.js +2 -2
- package/esm/domain/replay/segmentCollection/index.js.map +1 -0
- package/esm/domain/replay/segmentCollection/segment.js +21 -77
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -0
- package/esm/domain/replay/segmentCollection/segmentCollection.js +40 -53
- package/esm/domain/replay/segmentCollection/segmentCollection.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/recorderApi.js +43 -32
- package/src/boot/rum.js +45 -10
- package/src/boot/startRecording.js +7 -3
- 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 +138 -0
- package/src/domain/replay/deflate/deflateEncoder.js +88 -0
- package/src/domain/replay/{segmentCollection/startDeflateWorker.js → deflate/deflateWorker.js} +55 -32
- package/src/domain/replay/deflate/index.js +7 -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/replay/segmentCollection/buildReplayPayload.js +1 -1
- package/src/domain/replay/segmentCollection/index.js +0 -1
- package/src/domain/replay/segmentCollection/segment.js +28 -83
- package/src/domain/replay/segmentCollection/segmentCollection.js +49 -55
- 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/replay/segmentCollection/startDeflateWorker.js +0 -145
- package/cjs/domain/rumEventsCollection/view/trackViewMetrics.js +0 -156
- package/esm/domain/replay/segmentCollection/startDeflateWorker.js +0 -128
- package/esm/domain/rumEventsCollection/view/trackViewMetrics.js +0 -146
- package/src/domain/rumEventsCollection/view/trackViewMetrics.js +0 -176
|
@@ -6,29 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.startRequestCollection = startRequestCollection;
|
|
7
7
|
exports.trackFetch = trackFetch;
|
|
8
8
|
exports.trackXhr = trackXhr;
|
|
9
|
-
|
|
10
9
|
var _browserCore = require("@cloudcare/browser-core");
|
|
11
|
-
|
|
12
10
|
var _resourceUtils = require("./rumEventsCollection/resource/resourceUtils");
|
|
13
|
-
|
|
14
11
|
var _tracer = require("./tracing/tracer");
|
|
15
|
-
|
|
16
12
|
var nextRequestIndex = 1;
|
|
17
|
-
|
|
18
13
|
function startRequestCollection(lifeCycle, configuration, sessionManager) {
|
|
19
14
|
var tracer = (0, _tracer.startTracer)(configuration, sessionManager);
|
|
20
15
|
trackXhr(lifeCycle, configuration, tracer);
|
|
21
16
|
trackFetch(lifeCycle, configuration, tracer);
|
|
22
17
|
}
|
|
23
|
-
|
|
24
18
|
function trackXhr(lifeCycle, configuration, tracer) {
|
|
25
19
|
var subscription = (0, _browserCore.initXhrObservable)().subscribe(function (rawContext) {
|
|
26
20
|
var context = rawContext;
|
|
27
|
-
|
|
28
21
|
if (!(0, _resourceUtils.isAllowedRequestUrl)(configuration, context.url)) {
|
|
29
22
|
return;
|
|
30
23
|
}
|
|
31
|
-
|
|
32
24
|
switch (context.state) {
|
|
33
25
|
case 'start':
|
|
34
26
|
tracer.traceXhr(context, context.xhr);
|
|
@@ -38,7 +30,6 @@ function trackXhr(lifeCycle, configuration, tracer) {
|
|
|
38
30
|
url: context.url
|
|
39
31
|
});
|
|
40
32
|
break;
|
|
41
|
-
|
|
42
33
|
case 'complete':
|
|
43
34
|
tracer.clearTracingIfNeeded(context);
|
|
44
35
|
lifeCycle.notify(_browserCore.LifeCycleEventType.REQUEST_COMPLETED, {
|
|
@@ -63,15 +54,12 @@ function trackXhr(lifeCycle, configuration, tracer) {
|
|
|
63
54
|
}
|
|
64
55
|
};
|
|
65
56
|
}
|
|
66
|
-
|
|
67
57
|
function trackFetch(lifeCycle, configuration, tracer) {
|
|
68
58
|
var subscription = (0, _browserCore.initFetchObservable)().subscribe(function (rawContext) {
|
|
69
59
|
var context = rawContext;
|
|
70
|
-
|
|
71
60
|
if (!(0, _resourceUtils.isAllowedRequestUrl)(configuration, context.url)) {
|
|
72
61
|
return;
|
|
73
62
|
}
|
|
74
|
-
|
|
75
63
|
switch (context.state) {
|
|
76
64
|
case 'start':
|
|
77
65
|
tracer.traceFetch(context);
|
|
@@ -81,7 +69,6 @@ function trackFetch(lifeCycle, configuration, tracer) {
|
|
|
81
69
|
url: context.url
|
|
82
70
|
});
|
|
83
71
|
break;
|
|
84
|
-
|
|
85
72
|
case 'resolve':
|
|
86
73
|
waitForResponseToComplete(context, function (duration) {
|
|
87
74
|
tracer.clearTracingIfNeeded(context);
|
|
@@ -111,16 +98,13 @@ function trackFetch(lifeCycle, configuration, tracer) {
|
|
|
111
98
|
}
|
|
112
99
|
};
|
|
113
100
|
}
|
|
114
|
-
|
|
115
101
|
function getNextRequestIndex() {
|
|
116
102
|
var result = nextRequestIndex;
|
|
117
103
|
nextRequestIndex += 1;
|
|
118
104
|
return result;
|
|
119
105
|
}
|
|
120
|
-
|
|
121
106
|
function waitForResponseToComplete(context, callback) {
|
|
122
107
|
var clonedResponse = context.response && (0, _browserCore.tryToClone)(context.response);
|
|
123
|
-
|
|
124
108
|
if (!clonedResponse || !clonedResponse.body) {
|
|
125
109
|
// do not try to wait for the response if the clone failed, fetch error or null body
|
|
126
110
|
callback((0, _browserCore.elapsed)(context.startClocks.timeStamp, (0, _browserCore.timeStampNow)()));
|
|
@@ -132,4 +116,5 @@ function waitForResponseToComplete(context, callback) {
|
|
|
132
116
|
collectStreamBody: false
|
|
133
117
|
});
|
|
134
118
|
}
|
|
135
|
-
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=requestCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestCollection.js","names":["_browserCore","require","_resourceUtils","_tracer","nextRequestIndex","startRequestCollection","lifeCycle","configuration","sessionManager","tracer","startTracer","trackXhr","trackFetch","subscription","initXhrObservable","subscribe","rawContext","context","isAllowedRequestUrl","url","state","traceXhr","xhr","requestIndex","getNextRequestIndex","notify","LifeCycleEventType","REQUEST_STARTED","clearTracingIfNeeded","REQUEST_COMPLETED","duration","method","spanId","startClocks","status","traceId","traceSampled","type","RequestType","XHR","stop","unsubscribe","initFetchObservable","traceFetch","waitForResponseToComplete","responseType","FETCH","response","init","input","result","callback","clonedResponse","tryToClone","body","elapsed","timeStamp","timeStampNow","readBytesFromStream","bytesLimit","Number","POSITIVE_INFINITY","collectStreamBody"],"sources":["../../src/domain/requestCollection.js"],"sourcesContent":["import {\n RequestType,\n initFetchObservable,\n initXhrObservable,\n LifeCycleEventType,\n tryToClone,\n readBytesFromStream,\n elapsed,\n timeStampNow\n} from '@cloudcare/browser-core'\nimport { isAllowedRequestUrl } from './rumEventsCollection/resource/resourceUtils'\nimport { startTracer } from './tracing/tracer'\n\nvar nextRequestIndex = 1\n\nexport function startRequestCollection(\n lifeCycle,\n configuration,\n sessionManager\n) {\n var tracer = startTracer(configuration, sessionManager)\n trackXhr(lifeCycle, configuration, tracer)\n trackFetch(lifeCycle, configuration, tracer)\n}\n\nexport function trackXhr(lifeCycle, configuration, tracer) {\n var subscription = initXhrObservable().subscribe(function (rawContext) {\n var context = rawContext\n if (!isAllowedRequestUrl(configuration, context.url)) {\n return\n }\n\n switch (context.state) {\n case 'start':\n tracer.traceXhr(context, context.xhr)\n context.requestIndex = getNextRequestIndex()\n\n lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, {\n requestIndex: context.requestIndex,\n url: context.url\n })\n break\n case 'complete':\n tracer.clearTracingIfNeeded(context)\n lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, {\n duration: context.duration,\n method: context.method,\n requestIndex: context.requestIndex,\n spanId: context.spanId,\n startClocks: context.startClocks,\n status: context.status,\n traceId: context.traceId,\n traceSampled: context.traceSampled,\n type: RequestType.XHR,\n url: context.url,\n xhr: context.xhr\n })\n break\n }\n })\n\n return {\n stop: function () {\n return subscription.unsubscribe()\n }\n }\n}\n\nexport function trackFetch(lifeCycle, configuration, tracer) {\n var subscription = initFetchObservable().subscribe(function (rawContext) {\n var context = rawContext\n if (!isAllowedRequestUrl(configuration, context.url)) {\n return\n }\n\n switch (context.state) {\n case 'start':\n tracer.traceFetch(context)\n context.requestIndex = getNextRequestIndex()\n\n lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, {\n requestIndex: context.requestIndex,\n url: context.url\n })\n break\n case 'resolve':\n waitForResponseToComplete(context, function (duration) {\n tracer.clearTracingIfNeeded(context)\n lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, {\n duration: duration,\n method: context.method,\n requestIndex: context.requestIndex,\n responseType: context.responseType,\n spanId: context.spanId,\n startClocks: context.startClocks,\n status: context.status,\n traceId: context.traceId,\n traceSampled: context.traceSampled,\n type: RequestType.FETCH,\n url: context.url,\n response: context.response,\n init: context.init,\n input: context.input\n })\n })\n break\n }\n })\n return {\n stop: function () {\n return subscription.unsubscribe()\n }\n }\n}\n\nfunction getNextRequestIndex() {\n var result = nextRequestIndex\n nextRequestIndex += 1\n return result\n}\n\nfunction waitForResponseToComplete(context, callback) {\n var clonedResponse = context.response && tryToClone(context.response)\n if (!clonedResponse || !clonedResponse.body) {\n // do not try to wait for the response if the clone failed, fetch error or null body\n callback(elapsed(context.startClocks.timeStamp, timeStampNow()))\n } else {\n readBytesFromStream(\n clonedResponse.body,\n function () {\n callback(elapsed(context.startClocks.timeStamp, timeStampNow()))\n },\n {\n bytesLimit: Number.POSITIVE_INFINITY,\n collectStreamBody: false\n }\n )\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAIG,gBAAgB,GAAG,CAAC;AAEjB,SAASC,sBAAsBA,CACpCC,SAAS,EACTC,aAAa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AAC,CAAC,CAAC,CAAC;IAClE,CAAC,EACD;MACEE,UAAU,EAAEC,MAAM,CAACC,iBAAiB;MACpCC,iBAAiB,EAAE;IACrB,CACF,CAAC;EACH;AACF"}
|
|
@@ -4,34 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.startActionCollection = startActionCollection;
|
|
7
|
-
|
|
8
7
|
var _browserCore = require("@cloudcare/browser-core");
|
|
9
|
-
|
|
10
8
|
var _trackClickActions = require("./trackClickActions");
|
|
11
|
-
|
|
12
|
-
function startActionCollection(lifeCycle, domMutationObservable, configuration, foregroundContexts) {
|
|
9
|
+
function startActionCollection(lifeCycle, domMutationObservable, configuration, pageStateHistory) {
|
|
13
10
|
lifeCycle.subscribe(_browserCore.LifeCycleEventType.AUTO_ACTION_COMPLETED, function (action) {
|
|
14
|
-
lifeCycle.notify(_browserCore.LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processAction(action,
|
|
11
|
+
lifeCycle.notify(_browserCore.LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, processAction(action, pageStateHistory));
|
|
15
12
|
});
|
|
16
13
|
var actionContexts = {
|
|
17
|
-
findActionId: _browserCore.noop
|
|
14
|
+
findActionId: _browserCore.noop,
|
|
15
|
+
findAllActionId: _browserCore.noop
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
if (configuration.trackUserInteractions) {
|
|
21
18
|
actionContexts = (0, _trackClickActions.trackClickActions)(lifeCycle, domMutationObservable, configuration).actionContexts;
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
return {
|
|
25
21
|
actionContexts: actionContexts,
|
|
26
22
|
addAction: function addAction(action, savedCommonContext) {
|
|
27
23
|
lifeCycle.notify(_browserCore.LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, (0, _browserCore.extend)({
|
|
28
24
|
savedCommonContext: savedCommonContext
|
|
29
|
-
}, processAction(action,
|
|
25
|
+
}, processAction(action, pageStateHistory)));
|
|
30
26
|
}
|
|
31
27
|
};
|
|
32
28
|
}
|
|
33
|
-
|
|
34
|
-
function processAction(action, foregroundContexts) {
|
|
29
|
+
function processAction(action, pageStateHistory) {
|
|
35
30
|
var autoActionProperties = isAutoAction(action) ? {
|
|
36
31
|
action: {
|
|
37
32
|
error: {
|
|
@@ -70,16 +65,11 @@ function processAction(action, foregroundContexts) {
|
|
|
70
65
|
type: action.type
|
|
71
66
|
},
|
|
72
67
|
date: action.startClocks.timeStamp,
|
|
73
|
-
type: _browserCore.RumEventType.ACTION
|
|
68
|
+
type: _browserCore.RumEventType.ACTION,
|
|
69
|
+
view: {
|
|
70
|
+
in_foreground: pageStateHistory.isInActivePageStateAt(action.startClocks.relative)
|
|
71
|
+
}
|
|
74
72
|
}, autoActionProperties);
|
|
75
|
-
var inForeground = foregroundContexts.isInForegroundAt(action.startClocks.relative);
|
|
76
|
-
|
|
77
|
-
if (inForeground !== undefined) {
|
|
78
|
-
actionEvent.view = {
|
|
79
|
-
in_foreground: inForeground
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
73
|
return {
|
|
84
74
|
customerContext: customerContext,
|
|
85
75
|
rawRumEvent: actionEvent,
|
|
@@ -90,7 +80,7 @@ function processAction(action, foregroundContexts) {
|
|
|
90
80
|
} : {}
|
|
91
81
|
};
|
|
92
82
|
}
|
|
93
|
-
|
|
94
83
|
function isAutoAction(action) {
|
|
95
84
|
return action.type !== _browserCore.ActionType.CUSTOM;
|
|
96
|
-
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=actionCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionCollection.js","names":["_browserCore","require","_trackClickActions","startActionCollection","lifeCycle","domMutationObservable","configuration","pageStateHistory","subscribe","LifeCycleEventType","AUTO_ACTION_COMPLETED","action","notify","RAW_RUM_EVENT_COLLECTED","processAction","actionContexts","findActionId","noop","findAllActionId","trackUserInteractions","trackClickActions","addAction","savedCommonContext","extend","autoActionProperties","isAutoAction","error","count","counts","errorCount","id","loadingTime","toServerDuration","duration","frustration","type","frustrationTypes","long_task","longTaskCount","resource","resourceCount","_gc","target","position","customerContext","context","undefined","actionEvent","extend2Lev","UUID","name","date","startClocks","timeStamp","RumEventType","ACTION","view","in_foreground","isInActivePageStateAt","relative","rawRumEvent","startTime","domainContext","event","events","ActionType","CUSTOM"],"sources":["../../../../src/domain/rumEventsCollection/actions/actionCollection.js"],"sourcesContent":["import {\n toServerDuration,\n extend,\n extend2Lev,\n ActionType,\n RumEventType,\n LifeCycleEventType,\n UUID,\n noop\n} from '@cloudcare/browser-core'\nimport { trackClickActions } from './trackClickActions'\nexport function startActionCollection(\n lifeCycle,\n domMutationObservable,\n configuration,\n pageStateHistory\n) {\n lifeCycle.subscribe(\n LifeCycleEventType.AUTO_ACTION_COMPLETED,\n function (action) {\n lifeCycle.notify(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n processAction(action, pageStateHistory)\n )\n }\n )\n\n var actionContexts = { findActionId: noop, findAllActionId: noop }\n if (configuration.trackUserInteractions) {\n actionContexts = trackClickActions(\n lifeCycle,\n domMutationObservable,\n configuration\n ).actionContexts\n }\n return {\n actionContexts: actionContexts,\n addAction: function (action, savedCommonContext) {\n lifeCycle.notify(\n LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,\n extend(\n { savedCommonContext: savedCommonContext },\n processAction(action, pageStateHistory)\n )\n )\n }\n }\n}\n\nfunction processAction(action, pageStateHistory) {\n var autoActionProperties = isAutoAction(action)\n ? {\n action: {\n error: {\n count: action.counts.errorCount\n },\n id: action.id,\n loadingTime: toServerDuration(action.duration),\n frustration: {\n type: action.frustrationTypes\n },\n long_task: {\n count: action.counts.longTaskCount\n },\n resource: {\n count: action.counts.resourceCount\n }\n },\n _gc: {\n action: {\n target: action.target,\n position: action.position\n }\n }\n }\n : {\n action: {\n loadingTime: 0\n }\n }\n var customerContext = !isAutoAction(action) ? action.context : undefined\n var actionEvent = extend2Lev(\n {\n action: {\n id: UUID(),\n target: {\n name: action.name\n },\n type: action.type\n },\n date: action.startClocks.timeStamp,\n type: RumEventType.ACTION,\n view: {\n in_foreground: pageStateHistory.isInActivePageStateAt(\n action.startClocks.relative\n )\n }\n },\n autoActionProperties\n )\n\n return {\n customerContext: customerContext,\n rawRumEvent: actionEvent,\n startTime: action.startClocks.relative,\n domainContext: isAutoAction(action)\n ? { event: action.event, events: action.events }\n : {}\n }\n}\n\nfunction isAutoAction(action) {\n return action.type !== ActionType.CUSTOM\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,kBAAA,GAAAD,OAAA;AACO,SAASE,qBAAqBA,CACnCC,SAAS,EACTC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChB;EACAH,SAAS,CAACI,SAAS,CACjBC,+BAAkB,CAACC,qBAAqB,EACxC,UAAUC,MAAM,EAAE;IAChBP,SAAS,CAACQ,MAAM,CACdH,+BAAkB,CAACI,uBAAuB,EAC1CC,aAAa,CAACH,MAAM,EAAEJ,gBAAgB,CACxC,CAAC;EACH,CACF,CAAC;EAED,IAAIQ,cAAc,GAAG;IAAEC,YAAY,EAAEC,iBAAI;IAAEC,eAAe,EAAED;EAAK,CAAC;EAClE,IAAIX,aAAa,CAACa,qBAAqB,EAAE;IACvCJ,cAAc,GAAG,IAAAK,oCAAiB,EAChChB,SAAS,EACTC,qBAAqB,EACrBC,aACF,CAAC,CAACS,cAAc;EAClB;EACA,OAAO;IACLA,cAAc,EAAEA,cAAc;IAC9BM,SAAS,EAAE,SAAAA,UAAUV,MAAM,EAAEW,kBAAkB,EAAE;MAC/ClB,SAAS,CAACQ,MAAM,CACdH,+BAAkB,CAACI,uBAAuB,EAC1C,IAAAU,mBAAM,EACJ;QAAED,kBAAkB,EAAEA;MAAmB,CAAC,EAC1CR,aAAa,CAACH,MAAM,EAAEJ,gBAAgB,CACxC,CACF,CAAC;IACH;EACF,CA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yC,WAAW,CAACO,QACrB;IACF;EACF,CAAC,EACDnC,oBACF,CAAC;EAED,OAAO;IACLoB,eAAe,EAAEA,eAAe;IAChCgB,WAAW,EAAEb,WAAW;IACxBc,SAAS,EAAElD,MAAM,CAACyC,WAAW,CAACO,QAAQ;IACtCG,aAAa,EAAErC,YAAY,CAACd,MAAM,CAAC,GAC/B;MAAEoD,KAAK,EAAEpD,MAAM,CAACoD,KAAK;MAAEC,MAAM,EAAErD,MAAM,CAACqD;IAAO,CAAC,GAC9C,CAAC;EACP,CAAC;AACH;AAEA,SAASvC,YAAYA,CAACd,MAAM,EAAE;EAC5B,OAAOA,MAAM,CAACwB,IAAI,KAAK8B,uBAAU,CAACC,MAAM;AAC1C"}
|
|
@@ -5,9 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MAX_DURATION_BETWEEN_CLICKS = exports.MAX_DISTANCE_BETWEEN_CLICKS = void 0;
|
|
7
7
|
exports.createClickChain = createClickChain;
|
|
8
|
-
|
|
9
8
|
var _browserCore = require("@cloudcare/browser-core");
|
|
10
|
-
|
|
11
9
|
var MAX_DURATION_BETWEEN_CLICKS = _browserCore.ONE_SECOND;
|
|
12
10
|
exports.MAX_DURATION_BETWEEN_CLICKS = MAX_DURATION_BETWEEN_CLICKS;
|
|
13
11
|
var MAX_DISTANCE_BETWEEN_CLICKS = 100;
|
|
@@ -17,20 +15,17 @@ var ClickChainStatus = {
|
|
|
17
15
|
WaitingForClicksToStop: 1,
|
|
18
16
|
Finalized: 2
|
|
19
17
|
};
|
|
20
|
-
|
|
21
18
|
function createClickChain(firstClick, onFinalize) {
|
|
22
19
|
var bufferedClicks = [];
|
|
23
20
|
var status = ClickChainStatus.WaitingForMoreClicks;
|
|
24
21
|
var maxDurationBetweenClicksTimeout;
|
|
25
22
|
appendClick(firstClick);
|
|
26
|
-
|
|
27
23
|
function appendClick(click) {
|
|
28
24
|
click.stopObservable.subscribe(tryFinalize);
|
|
29
25
|
bufferedClicks.push(click);
|
|
30
26
|
(0, _browserCore.clearTimeout)(maxDurationBetweenClicksTimeout);
|
|
31
27
|
maxDurationBetweenClicksTimeout = (0, _browserCore.setTimeout)(dontAcceptMoreClick, MAX_DURATION_BETWEEN_CLICKS);
|
|
32
28
|
}
|
|
33
|
-
|
|
34
29
|
function tryFinalize() {
|
|
35
30
|
if (status === ClickChainStatus.WaitingForClicksToStop && (0, _browserCore.every)(bufferedClicks, function (click) {
|
|
36
31
|
return click.isStopped();
|
|
@@ -39,27 +34,22 @@ function createClickChain(firstClick, onFinalize) {
|
|
|
39
34
|
onFinalize(bufferedClicks);
|
|
40
35
|
}
|
|
41
36
|
}
|
|
42
|
-
|
|
43
37
|
function dontAcceptMoreClick() {
|
|
44
38
|
(0, _browserCore.clearTimeout)(maxDurationBetweenClicksTimeout);
|
|
45
|
-
|
|
46
39
|
if (status === ClickChainStatus.WaitingForMoreClicks) {
|
|
47
40
|
status = ClickChainStatus.WaitingForClicksToStop;
|
|
48
41
|
tryFinalize();
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
|
-
|
|
52
44
|
return {
|
|
53
45
|
tryAppend: function tryAppend(click) {
|
|
54
46
|
if (status !== ClickChainStatus.WaitingForMoreClicks) {
|
|
55
47
|
return false;
|
|
56
48
|
}
|
|
57
|
-
|
|
58
49
|
if (bufferedClicks.length > 0 && !areEventsSimilar(bufferedClicks[bufferedClicks.length - 1].event, click.event)) {
|
|
59
50
|
dontAcceptMoreClick();
|
|
60
51
|
return false;
|
|
61
52
|
}
|
|
62
|
-
|
|
63
53
|
appendClick(click);
|
|
64
54
|
return true;
|
|
65
55
|
},
|
|
@@ -68,15 +58,14 @@ function createClickChain(firstClick, onFinalize) {
|
|
|
68
58
|
}
|
|
69
59
|
};
|
|
70
60
|
}
|
|
61
|
+
|
|
71
62
|
/**
|
|
72
63
|
* Checks whether two events are similar by comparing their target, position and timestamp
|
|
73
64
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
65
|
function areEventsSimilar(first, second) {
|
|
77
66
|
return first.target === second.target && mouseEventDistance(first, second) <= MAX_DISTANCE_BETWEEN_CLICKS && first.timeStamp - second.timeStamp <= MAX_DURATION_BETWEEN_CLICKS;
|
|
78
67
|
}
|
|
79
|
-
|
|
80
68
|
function mouseEventDistance(origin, other) {
|
|
81
69
|
return Math.sqrt(Math.pow(origin.clientX - other.clientX, 2) + Math.pow(origin.clientY - other.clientY, 2));
|
|
82
|
-
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=clickChain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clickChain.js","names":["_browserCore","require","MAX_DURATION_BETWEEN_CLICKS","ONE_SECOND","exports","MAX_DISTANCE_BETWEEN_CLICKS","ClickChainStatus","WaitingForMoreClicks","WaitingForClicksToStop","Finalized","createClickChain","firstClick","onFinalize","bufferedClicks","status","maxDurationBetweenClicksTimeout","appendClick","click","stopObservable","subscribe","tryFinalize","push","clearTimeout","setTimeout","dontAcceptMoreClick","every","isStopped","tryAppend","length","areEventsSimilar","event","stop","first","second","target","mouseEventDistance","timeStamp","origin","other","Math","sqrt","pow","clientX","clientY"],"sources":["../../../../src/domain/rumEventsCollection/actions/clickChain.js"],"sourcesContent":["import {\n ONE_SECOND,\n every,\n setTimeout,\n clearTimeout\n} from '@cloudcare/browser-core'\n\nexport var MAX_DURATION_BETWEEN_CLICKS = ONE_SECOND\nexport var MAX_DISTANCE_BETWEEN_CLICKS = 100\n\nvar ClickChainStatus = {\n WaitingForMoreClicks: 0,\n WaitingForClicksToStop: 1,\n Finalized: 2\n}\n\nexport function createClickChain(firstClick, onFinalize) {\n var bufferedClicks = []\n var status = ClickChainStatus.WaitingForMoreClicks\n var maxDurationBetweenClicksTimeout\n appendClick(firstClick)\n\n function appendClick(click) {\n click.stopObservable.subscribe(tryFinalize)\n bufferedClicks.push(click)\n clearTimeout(maxDurationBetweenClicksTimeout)\n maxDurationBetweenClicksTimeout = setTimeout(\n dontAcceptMoreClick,\n MAX_DURATION_BETWEEN_CLICKS\n )\n }\n\n function tryFinalize() {\n if (\n status === ClickChainStatus.WaitingForClicksToStop &&\n every(bufferedClicks, function (click) {\n return click.isStopped()\n })\n ) {\n status = ClickChainStatus.Finalized\n onFinalize(bufferedClicks)\n }\n }\n\n function dontAcceptMoreClick() {\n clearTimeout(maxDurationBetweenClicksTimeout)\n if (status === ClickChainStatus.WaitingForMoreClicks) {\n status = ClickChainStatus.WaitingForClicksToStop\n tryFinalize()\n }\n }\n\n return {\n tryAppend: function (click) {\n if (status !== ClickChainStatus.WaitingForMoreClicks) {\n return false\n }\n\n if (\n bufferedClicks.length > 0 &&\n !areEventsSimilar(\n bufferedClicks[bufferedClicks.length - 1].event,\n click.event\n )\n ) {\n dontAcceptMoreClick()\n return false\n }\n\n appendClick(click)\n return true\n },\n stop: function () {\n dontAcceptMoreClick()\n }\n }\n}\n\n/**\n * Checks whether two events are similar by comparing their target, position and timestamp\n */\nfunction areEventsSimilar(first, second) {\n return (\n first.target === second.target &&\n mouseEventDistance(first, second) <= MAX_DISTANCE_BETWEEN_CLICKS &&\n first.timeStamp - second.timeStamp <= MAX_DURATION_BETWEEN_CLICKS\n )\n}\n\nfunction mouseEventDistance(origin, other) {\n return Math.sqrt(\n Math.pow(origin.clientX - other.clientX, 2) +\n Math.pow(origin.clientY - other.clientY, 2)\n )\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOO,IAAIC,2BAA2B,GAAGC,uBAAU;AAAAC,OAAA,CAAAF,2BAAA,GAAAA,2BAAA;AAC5C,IAAIG,2BAA2B,GAAG,GAAG;AAAAD,OAAA,CAAAC,2BAAA,GAAAA,2BAAA;AAE5C,IAAIC,gBAAgB,GAAG;EACrBC,oBAAoB,EAAE,CAAC;EACvBC,sBAAsB,EAAE,CAAC;EACzBC,SAAS,EAAE;AACb,CAAC;AAEM,SAASC,gBAAgBA,CAACC,UAAU,EAAEC,UAAU,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AAC;QACrB,OAAO,KAAK;MACd;MAEAR,WAAW,CAACC,KAAK,CAAC;MAClB,OAAO,IAAI;IACb,CAAC;IACDc,IAAI,EAAE,SAAAA,KAAA,EAAY;MAChBP,mBAAmB,CAAC,CAAC;IACvB;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA,SAASK,gBAAgBA,CAACG,KAAK,EAAEC,MAAM,EAAE;EACvC,OACED,KAAK,CAACE,MAAM,KAAKD,MAAM,CAACC,MAAM,IAC9BC,kBAAkB,CAACH,KAAK,EAAEC,MAAM,CAAC,IAAI5B,2BAA2B,IAChE2B,KAAK,CAACI,SAAS,GAAGH,MAAM,CAACG,SAAS,IAAIlC,2BAA2B;AAErE;AAEA,SAASiC,kBAAkBA,CAACE,MAAM,EAAEC,KAAK,EAAE;EACzC,OAAOC,IAAI,CAACC,IAAI,CACdD,IAAI,CAACE,GAAG,CAACJ,MAAM,CAACK,OAAO,GAAGJ,KAAK,CAACI,OAAO,EAAE,CAAC,CAAC,GACzCH,IAAI,CAACE,GAAG,CAACJ,MAAM,CAACM,OAAO,GAAGL,KAAK,CAACK,OAAO,EAAE,CAAC,CAC9C,CAAC;AACH"}
|
|
@@ -6,28 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.computeFrustration = computeFrustration;
|
|
7
7
|
exports.isDead = isDead;
|
|
8
8
|
exports.isRage = isRage;
|
|
9
|
-
|
|
10
9
|
var _browserCore = require("@cloudcare/browser-core");
|
|
11
|
-
|
|
12
10
|
var MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE = 3;
|
|
13
|
-
|
|
14
11
|
function computeFrustration(clicks, rageClick) {
|
|
15
12
|
if (isRage(clicks)) {
|
|
16
13
|
rageClick.addFrustration(_browserCore.FrustrationType.RAGE_CLICK);
|
|
17
|
-
|
|
18
14
|
if ((0, _browserCore.some)(clicks, isDead)) {
|
|
19
15
|
rageClick.addFrustration(_browserCore.FrustrationType.DEAD_CLICK);
|
|
20
16
|
}
|
|
21
|
-
|
|
22
17
|
if (rageClick.hasError()) {
|
|
23
18
|
rageClick.addFrustration(_browserCore.FrustrationType.ERROR_CLICK);
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
return {
|
|
27
21
|
isRage: true
|
|
28
22
|
};
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
var hasSelectionChanged = (0, _browserCore.some)(clicks, function (click) {
|
|
32
25
|
return click.getUserActivity().selection;
|
|
33
26
|
});
|
|
@@ -35,8 +28,8 @@ function computeFrustration(clicks, rageClick) {
|
|
|
35
28
|
if (click.hasError()) {
|
|
36
29
|
click.addFrustration(_browserCore.FrustrationType.ERROR_CLICK);
|
|
37
30
|
}
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
if (isDead(click) &&
|
|
32
|
+
// Avoid considering clicks part of a double-click or triple-click selections as dead clicks
|
|
40
33
|
!hasSelectionChanged) {
|
|
41
34
|
click.addFrustration(_browserCore.FrustrationType.DEAD_CLICK);
|
|
42
35
|
}
|
|
@@ -45,35 +38,34 @@ function computeFrustration(clicks, rageClick) {
|
|
|
45
38
|
isRage: false
|
|
46
39
|
};
|
|
47
40
|
}
|
|
48
|
-
|
|
49
41
|
function isRage(clicks) {
|
|
50
42
|
if ((0, _browserCore.some)(clicks, function (click) {
|
|
51
43
|
return click.getUserActivity().selection;
|
|
52
44
|
})) {
|
|
53
45
|
return false;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
47
|
for (var i = 0; i < clicks.length - (MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE - 1); i += 1) {
|
|
57
48
|
if (clicks[i + MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE - 1].event.timeStamp - clicks[i].event.timeStamp <= _browserCore.ONE_SECOND) {
|
|
58
49
|
return true;
|
|
59
50
|
}
|
|
60
51
|
}
|
|
61
|
-
|
|
62
52
|
return false;
|
|
63
53
|
}
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
var DEAD_CLICK_EXCLUDE_SELECTOR =
|
|
55
|
+
// inputs that don't trigger a meaningful event like "input" when clicked, including textual
|
|
66
56
|
// inputs (using a negative selector is shorter here)
|
|
67
|
-
'input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),' + 'textarea,' + 'select,' +
|
|
68
|
-
|
|
69
|
-
'
|
|
57
|
+
'input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),' + 'textarea,' + 'select,' +
|
|
58
|
+
// contenteditable and their descendants don't always trigger meaningful changes when manipulated
|
|
59
|
+
'[contenteditable],' + '[contenteditable] *,' +
|
|
60
|
+
// canvas, as there is no good way to detect activity occurring on them
|
|
61
|
+
'canvas,' +
|
|
62
|
+
// links that are interactive (have an href attribute) or any of their descendants, as they can
|
|
70
63
|
// open a new tab or navigate to a hash without triggering a meaningful event
|
|
71
64
|
'a[href],' + 'a[href] *';
|
|
72
|
-
|
|
73
65
|
function isDead(click) {
|
|
74
66
|
if (click.hasPageActivity() || click.getUserActivity().input) {
|
|
75
67
|
return false;
|
|
76
68
|
}
|
|
77
|
-
|
|
78
69
|
return !(0, _browserCore.elementMatches)(click.event.target, DEAD_CLICK_EXCLUDE_SELECTOR);
|
|
79
|
-
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=computeFrustration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeFrustration.js","names":["_browserCore","require","MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE","computeFrustration","clicks","rageClick","isRage","addFrustration","FrustrationType","RAGE_CLICK","some","isDead","DEAD_CLICK","hasError","ERROR_CLICK","hasSelectionChanged","click","getUserActivity","selection","each","i","length","event","timeStamp","ONE_SECOND","DEAD_CLICK_EXCLUDE_SELECTOR","hasPageActivity","input","elementMatches","target"],"sources":["../../../../src/domain/rumEventsCollection/actions/computeFrustration.js"],"sourcesContent":["import {\n elementMatches,\n ONE_SECOND,\n FrustrationType,\n some,\n each\n} from '@cloudcare/browser-core'\n\nvar MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE = 3\n\nexport function computeFrustration(clicks, rageClick) {\n if (isRage(clicks)) {\n rageClick.addFrustration(FrustrationType.RAGE_CLICK)\n if (some(clicks, isDead)) {\n rageClick.addFrustration(FrustrationType.DEAD_CLICK)\n }\n if (rageClick.hasError()) {\n rageClick.addFrustration(FrustrationType.ERROR_CLICK)\n }\n return { isRage: true }\n }\n\n var hasSelectionChanged = some(clicks, function (click) {\n return click.getUserActivity().selection\n })\n each(clicks, function (click) {\n if (click.hasError()) {\n click.addFrustration(FrustrationType.ERROR_CLICK)\n }\n if (\n isDead(click) &&\n // Avoid considering clicks part of a double-click or triple-click selections as dead clicks\n !hasSelectionChanged\n ) {\n click.addFrustration(FrustrationType.DEAD_CLICK)\n }\n })\n\n return { isRage: false }\n}\n\nexport function isRage(clicks) {\n if (\n some(clicks, function (click) {\n return click.getUserActivity().selection\n })\n ) {\n return false\n }\n for (\n var i = 0;\n i < clicks.length - (MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE - 1);\n i += 1\n ) {\n if (\n clicks[i + MIN_CLICKS_PER_SECOND_TO_CONSIDER_RAGE - 1].event.timeStamp -\n clicks[i].event.timeStamp <=\n ONE_SECOND\n ) {\n return true\n }\n }\n return false\n}\n\nvar DEAD_CLICK_EXCLUDE_SELECTOR =\n // inputs that don't trigger a meaningful event like \"input\" when clicked, including textual\n // inputs (using a negative selector is shorter here)\n 'input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"range\"]),' +\n 'textarea,' +\n 'select,' +\n // contenteditable and their descendants don't always trigger meaningful changes when manipulated\n '[contenteditable],' +\n '[contenteditable] *,' +\n // canvas, as there is no good way to detect activity occurring on them\n 'canvas,' +\n // links that are interactive (have an href attribute) or any of their descendants, as they can\n // open a new tab or navigate to a hash without triggering a meaningful event\n 'a[href],' +\n 'a[href] *'\n\nexport function isDead(click) {\n if (click.hasPageActivity() || click.getUserActivity().input) {\n return false\n }\n return !elementMatches(click.event.target, DEAD_CLICK_EXCLUDE_SELECTOR)\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAIC,sCAAsC,GAAG,CAAC;AAEvC,SAASC,kBAAkBA,CAACC,MAAM,EAAEC,SAAS,EAAE;EACpD,IAAIC,MAAM,CAACF,MAAM,CAAC,EAAE;IAClBC,SAAS,CAACE,cAAc,CAACC,4BAAe,CAACC,UAAU,CAAC;IACpD,IAAI,IAAAC,iBAAI,EAACN,MAAM,EAAEO,MAAM,CAAC,EAAE;MACxBN,SAAS,CAACE,cAAc,CAACC,4BAAe,CAACI,UAAU,CAAC;IACtD;IACA,IAAIP,SAAS,CAACQ,QAAQ,CAAC,CAAC,EAAE;MACxBR,SAAS,CAACE,cAAc,CAACC,4BAAe,CAACM,WAAW,CAAC;IACvD;IACA,OAAO;MAAER,MAAM,EAAE;IAAK,CAAC;EACzB;EAEA,IAAIS,mBAAmB,GAAG,IAAAL,iBAAI,EAACN,MAAM,EAAE,UAAUY,KAAK,EAAE;IACtD,OAAOA,KAAK,CAACC,eAAe,CAAC,CAAC,CAACC,SAAS;EAC1C,CAAC,CAAC;EACF,IAAAC,iBAAI,EAACf,MAAM,EAAE,UAAUY,KAAK,EAAE;IAC5B,IAAIA,KAAK,CAACH,QAAQ,CAAC,CAAC,EAAE;MACpBG,KAAK,CAACT,cAAc,CAACC,4BAAe,CAACM,WAAW,CAAC;IACnD;IACA,IACEH,MAAM,CAACK,KAAK,CAAC;IACb;IACA,CAACD,mBAAmB,EACpB;MACAC,KAAK,CAACT,cAAc,CAACC,4BAAe,CAACI,UAAU,CAAC;IAClD;EACF,CAAC,CAAC;EAEF,OAAO;IAAEN,MAAM,EAAE;EAAM,CAAC;AAC1B;AAEO,SAASA,MAAMA,CAACF,MAAM,EAAE;EAC7B,IACE,IAAAM,iBAAI,EAACN,MAAM,EAAE,UAAUY,KAAK,EAAE;IAC5B,OAAOA,KAAK,CAACC,eAAe,CAAC,CAAC,CAACC,SAAS;EAC1C,CAAC,CAAC,EACF;IACA,OAAO,KAAK;EACd;EACA,KACE,IAAIE,CAAC,GAAG,CAAC,EACTA,CAAC,GAAGhB,MAAM,CAACiB,MAAM,IAAInB,sCAAsC,GAAG,CAAC,CAAC,EAChEkB,CAAC,IAAI,CAAC,EACN;IACA,IACEhB,MAAM,CAACgB,CAAC,GAAGlB,sCAAsC,GAAG,CAAC,CAAC,CAACoB,KAAK,CAACC,SAAS,GACpEnB,MAAM,CAACgB,CAAC,CAAC,CAACE,KAAK,CAACC,SAAS,IAC3BC,uBAAU,EACV;MACA,OAAO,IAAI;IACb;EACF;EACA,OAAO,KAAK;AACd;AAEA,IAAIC,2BAA2B;AAC7B;AACA;AACA,qIAAqI,GACrI,WAAW,GACX,SAAS;AACT;AACA,oBAAoB,GACpB,sBAAsB;AACtB;AACA,SAAS;AACT;AACA;AACA,UAAU,GACV,WAAW;AAEN,SAASd,MAAMA,CAACK,KAAK,EAAE;EAC5B,IAAIA,KAAK,CAACU,eAAe,CAAC,CAAC,IAAIV,KAAK,CAACC,eAAe,CAAC,CAAC,CAACU,KAAK,EAAE;IAC5D,OAAO,KAAK;EACd;EACA,OAAO,CAAC,IAAAC,2BAAc,EAACZ,KAAK,CAACM,KAAK,CAACO,MAAM,EAAEJ,2BAA2B,CAAC;AACzE"}
|
|
@@ -5,12 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE = void 0;
|
|
7
7
|
exports.getActionNameFromElement = getActionNameFromElement;
|
|
8
|
-
|
|
9
8
|
var _browserCore = require("@cloudcare/browser-core");
|
|
10
|
-
|
|
11
9
|
var DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE = 'data-guance-action-name';
|
|
12
10
|
exports.DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE = DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE;
|
|
13
|
-
|
|
14
11
|
function getActionNameFromElement(element, userProgrammaticAttribute) {
|
|
15
12
|
// Proceed to get the action name in two steps:
|
|
16
13
|
// * first, get the name programmatically, explicitly defined by the user.
|
|
@@ -20,37 +17,32 @@ function getActionNameFromElement(element, userProgrammaticAttribute) {
|
|
|
20
17
|
// Those are much likely to succeed.
|
|
21
18
|
return getActionNameFromElementProgrammatically(element, DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE) || userProgrammaticAttribute && getActionNameFromElementProgrammatically(element, userProgrammaticAttribute) || getActionNameFromElementForStrategies(element, userProgrammaticAttribute, priorityStrategies) || getActionNameFromElementForStrategies(element, userProgrammaticAttribute, fallbackStrategies) || '';
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
function getActionNameFromElementProgrammatically(targetElement, programmaticAttribute) {
|
|
25
|
-
var elementWithAttribute;
|
|
21
|
+
var elementWithAttribute;
|
|
22
|
+
// We don't use getActionNameFromElementForStrategies here, because we want to consider all parents,
|
|
26
23
|
// without limit. It is up to the user to declare a relevant naming strategy.
|
|
27
24
|
// If available, use element.closest() to match get the attribute from the element or any of its
|
|
28
25
|
// parent. Else fallback to a more traditional implementation.
|
|
29
|
-
|
|
30
26
|
if (supportsElementClosest()) {
|
|
31
27
|
elementWithAttribute = targetElement.closest('[' + programmaticAttribute + ']');
|
|
32
28
|
} else {
|
|
33
29
|
var element = targetElement;
|
|
34
|
-
|
|
35
30
|
while (element) {
|
|
36
31
|
if (element.hasAttribute(programmaticAttribute)) {
|
|
37
32
|
elementWithAttribute = element;
|
|
38
33
|
break;
|
|
39
34
|
}
|
|
40
|
-
|
|
41
35
|
element = element.parentElement;
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
if (!elementWithAttribute) {
|
|
46
39
|
return;
|
|
47
40
|
}
|
|
48
|
-
|
|
49
41
|
var name = elementWithAttribute.getAttribute(programmaticAttribute);
|
|
50
42
|
return truncate(normalizeWhitespace(name.trim()));
|
|
51
43
|
}
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
var priorityStrategies = [
|
|
45
|
+
// associated LABEL text
|
|
54
46
|
function (element, userProgrammaticAttribute) {
|
|
55
47
|
// IE does not support element.labels, so we fallback to a CSS selector based on the element id
|
|
56
48
|
// instead
|
|
@@ -64,27 +56,28 @@ function (element, userProgrammaticAttribute) {
|
|
|
64
56
|
});
|
|
65
57
|
return label && getTextualContent(label, userProgrammaticAttribute);
|
|
66
58
|
}
|
|
67
|
-
},
|
|
59
|
+
},
|
|
60
|
+
// INPUT button (and associated) value
|
|
68
61
|
function (element) {
|
|
69
62
|
if (element.nodeName === 'INPUT') {
|
|
70
63
|
var input = element;
|
|
71
64
|
var type = input.getAttribute('type');
|
|
72
|
-
|
|
73
65
|
if (type === 'button' || type === 'submit' || type === 'reset') {
|
|
74
66
|
return input.value;
|
|
75
67
|
}
|
|
76
68
|
}
|
|
77
|
-
},
|
|
69
|
+
},
|
|
70
|
+
// BUTTON, LABEL or button-like element text
|
|
78
71
|
function (element, userProgrammaticAttribute) {
|
|
79
72
|
if (element.nodeName === 'BUTTON' || element.nodeName === 'LABEL' || element.getAttribute('role') === 'button') {
|
|
80
73
|
return getTextualContent(element, userProgrammaticAttribute);
|
|
81
74
|
}
|
|
82
75
|
}, function (element) {
|
|
83
76
|
return element.getAttribute('aria-label');
|
|
84
|
-
},
|
|
77
|
+
},
|
|
78
|
+
// associated element text designated by the aria-labelledby attribute
|
|
85
79
|
function (element, userProgrammaticAttribute) {
|
|
86
80
|
var labelledByAttribute = element.getAttribute('aria-labelledby');
|
|
87
|
-
|
|
88
81
|
if (labelledByAttribute) {
|
|
89
82
|
labelledByAttribute = labelledByAttribute.split(/\s+/);
|
|
90
83
|
labelledByAttribute = (0, _browserCore.map)(labelledByAttribute, function (id) {
|
|
@@ -106,7 +99,8 @@ function (element, userProgrammaticAttribute) {
|
|
|
106
99
|
return element.getAttribute('title');
|
|
107
100
|
}, function (element) {
|
|
108
101
|
return element.getAttribute('placeholder');
|
|
109
|
-
},
|
|
102
|
+
},
|
|
103
|
+
// SELECT first OPTION text
|
|
110
104
|
function (element, userProgrammaticAttribute) {
|
|
111
105
|
if ('options' in element && element.options.length > 0) {
|
|
112
106
|
return getTextualContent(element.options[0], userProgrammaticAttribute);
|
|
@@ -115,98 +109,80 @@ function (element, userProgrammaticAttribute) {
|
|
|
115
109
|
var fallbackStrategies = [function (element, userProgrammaticAttribute) {
|
|
116
110
|
return getTextualContent(element, userProgrammaticAttribute);
|
|
117
111
|
}];
|
|
112
|
+
|
|
118
113
|
/**
|
|
119
114
|
* Iterates over the target element and its parent, using the strategies list to get an action name.
|
|
120
115
|
* Each strategies are applied on each element, stopping as soon as a non-empty value is returned.
|
|
121
116
|
*/
|
|
122
|
-
|
|
123
117
|
var MAX_PARENTS_TO_CONSIDER = 10;
|
|
124
|
-
|
|
125
118
|
function getActionNameFromElementForStrategies(targetElement, userProgrammaticAttribute, strategies) {
|
|
126
119
|
var element = targetElement;
|
|
127
120
|
var recursionCounter = 0;
|
|
128
|
-
|
|
129
121
|
while (recursionCounter <= MAX_PARENTS_TO_CONSIDER && element && element.nodeName !== 'BODY' && element.nodeName !== 'HTML' && element.nodeName !== 'HEAD') {
|
|
130
122
|
for (var i = 0; i < strategies.length; i++) {
|
|
131
123
|
var strategy = strategies[i];
|
|
132
124
|
var name = strategy(element, userProgrammaticAttribute);
|
|
133
|
-
|
|
134
125
|
if (typeof name === 'string') {
|
|
135
126
|
var trimmedName = name.trim();
|
|
136
|
-
|
|
137
127
|
if (trimmedName) {
|
|
138
128
|
return truncate(normalizeWhitespace(trimmedName));
|
|
139
129
|
}
|
|
140
130
|
}
|
|
141
|
-
}
|
|
131
|
+
}
|
|
132
|
+
// Consider a FORM as a contextual limit to get the action name. This is experimental and may
|
|
142
133
|
// be reconsidered in the future.
|
|
143
|
-
|
|
144
|
-
|
|
145
134
|
if (element.nodeName === 'FORM') {
|
|
146
135
|
break;
|
|
147
136
|
}
|
|
148
|
-
|
|
149
137
|
element = element.parentElement;
|
|
150
138
|
recursionCounter += 1;
|
|
151
139
|
}
|
|
152
140
|
}
|
|
153
|
-
|
|
154
141
|
function normalizeWhitespace(s) {
|
|
155
142
|
return s.replace(/\s+/g, ' ');
|
|
156
143
|
}
|
|
157
|
-
|
|
158
144
|
function truncate(s) {
|
|
159
145
|
return s.length > 100 ? (0, _browserCore.safeTruncate)(s, 100) + ' [...]' : s;
|
|
160
146
|
}
|
|
161
|
-
|
|
162
147
|
function getElementById(refElement, id) {
|
|
163
148
|
// Use the element ownerDocument here, because tests are executed in an iframe, so
|
|
164
149
|
// document.getElementById won't work.
|
|
165
150
|
return refElement.ownerDocument ? refElement.ownerDocument.getElementById(id) : null;
|
|
166
151
|
}
|
|
167
|
-
|
|
168
152
|
function getTextualContent(element, userProgrammaticAttribute) {
|
|
169
153
|
if (element.isContentEditable) {
|
|
170
154
|
return;
|
|
171
155
|
}
|
|
172
|
-
|
|
173
156
|
if ('innerText' in element) {
|
|
174
157
|
var text = element.innerText;
|
|
175
|
-
|
|
176
158
|
var removeTextFromElements = function removeTextFromElements(query) {
|
|
177
159
|
var list = element.querySelectorAll(query);
|
|
178
|
-
|
|
179
160
|
for (var index = 0; index < list.length; index += 1) {
|
|
180
161
|
var _element = list[index];
|
|
181
|
-
|
|
182
162
|
if ('innerText' in _element) {
|
|
183
163
|
var textToReplace = _element.innerText;
|
|
184
|
-
|
|
185
164
|
if (textToReplace && textToReplace.trim().length > 0) {
|
|
186
165
|
text = text.replace(textToReplace, '');
|
|
187
166
|
}
|
|
188
167
|
}
|
|
189
168
|
}
|
|
190
169
|
};
|
|
191
|
-
|
|
192
170
|
if (!supportsInnerTextScriptAndStyleRemoval()) {
|
|
193
171
|
// remove the inner text of SCRIPT and STYLES from the result. This is a bit dirty, but should
|
|
194
172
|
// be relatively fast and work in most cases.
|
|
195
173
|
removeTextFromElements('script, style');
|
|
196
|
-
}
|
|
197
|
-
|
|
174
|
+
}
|
|
198
175
|
|
|
176
|
+
// remove the text of elements with programmatic attribute value
|
|
199
177
|
removeTextFromElements('[' + DEFAULT_PROGRAMMATIC_ACTION_NAME_ATTRIBUTE + ']');
|
|
200
|
-
|
|
201
178
|
if (userProgrammaticAttribute) {
|
|
202
179
|
removeTextFromElements('[' + userProgrammaticAttribute + ']');
|
|
203
180
|
}
|
|
204
|
-
|
|
205
181
|
return text;
|
|
206
182
|
}
|
|
207
|
-
|
|
208
183
|
return element.textContent;
|
|
209
184
|
}
|
|
185
|
+
|
|
210
186
|
/**
|
|
211
187
|
* Returns true if element.innerText excludes the text from inline SCRIPT and STYLE element. This
|
|
212
188
|
* should be the case everywhere except on Internet Explorer 10 and 11 (see [1])
|
|
@@ -223,42 +199,35 @@ function getTextualContent(element, userProgrammaticAttribute) {
|
|
|
223
199
|
*
|
|
224
200
|
* [1]: https://web.archive.org/web/20210602165716/http://perfectionkills.com/the-poor-misunderstood-innerText/#diff-with-textContent
|
|
225
201
|
*/
|
|
226
|
-
|
|
227
|
-
|
|
228
202
|
function supportsInnerTextScriptAndStyleRemoval() {
|
|
229
203
|
return !(0, _browserCore.isIE)();
|
|
230
204
|
}
|
|
205
|
+
|
|
231
206
|
/**
|
|
232
207
|
* Returns true if the browser supports the element.labels property. This should be the case
|
|
233
208
|
* everywhere except on Internet Explorer.
|
|
234
209
|
* Note: The result is computed lazily, because we don't want any DOM access when the SDK is
|
|
235
210
|
* evaluated.
|
|
236
211
|
*/
|
|
237
|
-
|
|
238
|
-
|
|
239
212
|
var supportsLabelPropertyResult;
|
|
240
|
-
|
|
241
213
|
function supportsLabelProperty() {
|
|
242
214
|
if (supportsLabelPropertyResult === undefined) {
|
|
243
215
|
supportsLabelPropertyResult = 'labels' in HTMLInputElement.prototype;
|
|
244
216
|
}
|
|
245
|
-
|
|
246
217
|
return supportsLabelPropertyResult;
|
|
247
218
|
}
|
|
219
|
+
|
|
248
220
|
/**
|
|
249
221
|
* Returns true if the browser supports the element.closest method. This should be the case
|
|
250
222
|
* everywhere except on Internet Explorer.
|
|
251
223
|
* Note: The result is computed lazily, because we don't want any DOM access when the SDK is
|
|
252
224
|
* evaluated.
|
|
253
225
|
*/
|
|
254
|
-
|
|
255
|
-
|
|
256
226
|
var supportsElementClosestResult;
|
|
257
|
-
|
|
258
227
|
function supportsElementClosest() {
|
|
259
228
|
if (supportsElementClosestResult === undefined) {
|
|
260
229
|
supportsElementClosestResult = 'closest' in HTMLElement.prototype;
|
|
261
230
|
}
|
|
262
|
-
|
|
263
231
|
return supportsElementClosestResult;
|
|
264
|
-
}
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=getActionNameFromElement.js.map
|