@cloudcare/browser-rum 3.3.6 → 3.3.7
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/README.md +24 -3
- package/README.zh.md +19 -3
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/buildEnv.js.map +1 -1
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +170 -200
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/recorderApiStub.js +3 -29
- package/cjs/boot/recorderApiStub.js.map +1 -1
- package/cjs/boot/rum.entry.js.map +1 -1
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rum.slim.entry.js.map +1 -1
- package/cjs/boot/rumEntryFactory.js.map +1 -1
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/rumRecorderApiStub.js.map +1 -1
- package/cjs/boot/rumSlimConfiguration.js.map +1 -1
- package/cjs/boot/sessionReplayPublicApi.js +14 -27
- package/cjs/boot/sessionReplayPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +333 -108
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/constants.js.map +1 -1
- package/cjs/domain/assembly.js +1 -7
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration.js +31 -43
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/contexts/commonContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/foregroundContexts.js.map +1 -1
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.js +10 -1
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/viewContexts.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.js +517 -39
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +194 -115
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/deflate/index.js.map +1 -1
- package/cjs/domain/domMutationObservable.js.map +1 -1
- package/cjs/domain/encoderStreamId.js.map +1 -1
- package/cjs/domain/firstInputPolyfill.js.map +1 -1
- package/cjs/domain/initViewportObservable.js.map +1 -1
- package/cjs/domain/locationChangeObservable.js.map +1 -1
- package/cjs/domain/performanceObservable.js.map +1 -1
- package/cjs/domain/performanceUtils.js.map +1 -1
- package/cjs/domain/plugins.js.map +1 -1
- package/cjs/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandCapture.js +968 -167
- package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandObserver.js +1058 -119
- package/cjs/domain/replay/record/canvasCommandObserver.js.map +1 -1
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +61 -37
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/cjs/domain/replay/record/canvasContext.js +63 -0
- package/cjs/domain/replay/record/canvasContext.js.map +1 -0
- package/cjs/domain/replay/record/canvasContinuousScheduler.js +246 -118
- package/cjs/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
- package/cjs/domain/replay/record/canvasEncodeBridge.js +539 -87
- package/cjs/domain/replay/record/canvasEncodeBridge.js.map +1 -1
- package/cjs/domain/replay/record/canvasEncodeWorker.js +50 -32
- package/cjs/domain/replay/record/canvasEncodeWorker.js.map +1 -1
- package/cjs/domain/replay/record/canvasFrameSignature.js +49 -17
- package/cjs/domain/replay/record/canvasFrameSignature.js.map +1 -1
- package/cjs/domain/replay/record/canvasMutationRecord.js.map +1 -1
- package/cjs/domain/replay/record/canvasObserver.js +295 -59
- package/cjs/domain/replay/record/canvasObserver.js.map +1 -1
- package/cjs/domain/replay/record/canvasSerializeArgs.js.map +1 -1
- package/cjs/domain/replay/record/canvasWebGLPluginHost.js +33 -0
- package/cjs/domain/replay/record/canvasWebGLPluginHost.js.map +1 -0
- package/cjs/domain/replay/record/elementsScrollPositions.js +3 -0
- package/cjs/domain/replay/record/elementsScrollPositions.js.map +1 -1
- package/cjs/domain/replay/record/index.js.map +1 -1
- package/cjs/domain/replay/record/mutationBatch.js +542 -25
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +1900 -191
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/mutationResourceBudget.js +144 -0
- package/cjs/domain/replay/record/mutationResourceBudget.js.map +1 -0
- package/cjs/domain/replay/record/observers.js +222 -53
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/privacy.js +31 -8
- package/cjs/domain/replay/record/privacy.js.map +1 -1
- package/cjs/domain/replay/record/record.js +3083 -321
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +426 -26
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +259 -49
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/record/shadowRootsController.js +875 -21
- package/cjs/domain/replay/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/replay/record/utils.js.map +1 -1
- package/cjs/domain/replay/record/viewports.js.map +1 -1
- package/cjs/domain/replay/replayStats.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/index.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segment.js +315 -11
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +956 -71
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/replay/startRecordBridge.js.map +1 -1
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js +29 -11
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/cjs/domain/tracing/ddtraceTracer.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
- package/cjs/domain/tracing/sampler.js.map +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.js +2 -2
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/usr/index.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/transport/startRumBatch.js +3 -1
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/cjs/types/index.js.map +1 -1
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/buildEnv.js.map +1 -1
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +172 -202
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/recorderApiStub.js +3 -29
- package/esm/boot/recorderApiStub.js.map +1 -1
- package/esm/boot/rum.entry.js.map +1 -1
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/rum.slim.entry.js.map +1 -1
- package/esm/boot/rumEntryFactory.js.map +1 -1
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/boot/rumRecorderApiStub.js.map +1 -1
- package/esm/boot/rumSlimConfiguration.js.map +1 -1
- package/esm/boot/sessionReplayPublicApi.js +14 -27
- package/esm/boot/sessionReplayPublicApi.js.map +1 -1
- package/esm/boot/startRecording.js +334 -109
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/constants.js.map +1 -1
- package/esm/domain/assembly.js +1 -7
- package/esm/domain/assembly.js.map +1 -1
- package/esm/domain/configuration.js +31 -43
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/contexts/commonContext.js.map +1 -1
- package/esm/domain/contexts/displayContext.js.map +1 -1
- package/esm/domain/contexts/foregroundContexts.js.map +1 -1
- package/esm/domain/contexts/internalContext.js.map +1 -1
- package/esm/domain/contexts/pageStateHistory.js.map +1 -1
- package/esm/domain/contexts/urlContexts.js +11 -2
- package/esm/domain/contexts/urlContexts.js.map +1 -1
- package/esm/domain/contexts/viewContexts.js.map +1 -1
- package/esm/domain/deflate/deflateEncoder.js +517 -39
- package/esm/domain/deflate/deflateEncoder.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +193 -116
- package/esm/domain/deflate/deflateWorker.js.map +1 -1
- package/esm/domain/deflate/index.js.map +1 -1
- package/esm/domain/domMutationObservable.js.map +1 -1
- package/esm/domain/encoderStreamId.js.map +1 -1
- package/esm/domain/firstInputPolyfill.js.map +1 -1
- package/esm/domain/initViewportObservable.js.map +1 -1
- package/esm/domain/locationChangeObservable.js.map +1 -1
- package/esm/domain/performanceObservable.js.map +1 -1
- package/esm/domain/performanceUtils.js.map +1 -1
- package/esm/domain/plugins.js.map +1 -1
- package/esm/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandCapture.js +968 -168
- package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandObserver.js +1058 -119
- package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -1
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js +60 -37
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
- package/esm/domain/replay/record/canvasContext.js +50 -0
- package/esm/domain/replay/record/canvasContext.js.map +1 -0
- package/esm/domain/replay/record/canvasContinuousScheduler.js +246 -118
- package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
- package/esm/domain/replay/record/canvasEncodeBridge.js +539 -87
- package/esm/domain/replay/record/canvasEncodeBridge.js.map +1 -1
- package/esm/domain/replay/record/canvasEncodeWorker.js +51 -33
- package/esm/domain/replay/record/canvasEncodeWorker.js.map +1 -1
- package/esm/domain/replay/record/canvasFrameSignature.js +50 -17
- package/esm/domain/replay/record/canvasFrameSignature.js.map +1 -1
- package/esm/domain/replay/record/canvasMutationRecord.js.map +1 -1
- package/esm/domain/replay/record/canvasObserver.js +295 -59
- package/esm/domain/replay/record/canvasObserver.js.map +1 -1
- package/esm/domain/replay/record/canvasSerializeArgs.js.map +1 -1
- package/esm/domain/replay/record/canvasWebGLPluginHost.js +26 -0
- package/esm/domain/replay/record/canvasWebGLPluginHost.js.map +1 -0
- package/esm/domain/replay/record/elementsScrollPositions.js +3 -0
- package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -1
- package/esm/domain/replay/record/index.js.map +1 -1
- package/esm/domain/replay/record/mutationBatch.js +541 -25
- package/esm/domain/replay/record/mutationBatch.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js +1892 -195
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/mutationResourceBudget.js +137 -0
- package/esm/domain/replay/record/mutationResourceBudget.js.map +1 -0
- package/esm/domain/replay/record/observers.js +224 -55
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/privacy.js +30 -7
- package/esm/domain/replay/record/privacy.js.map +1 -1
- package/esm/domain/replay/record/record.js +3086 -325
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serializationUtils.js +422 -25
- package/esm/domain/replay/record/serializationUtils.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +258 -50
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/record/shadowRootsController.js +875 -21
- package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
- package/esm/domain/replay/record/utils.js.map +1 -1
- package/esm/domain/replay/record/viewports.js.map +1 -1
- package/esm/domain/replay/replayStats.js.map +1 -1
- package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
- package/esm/domain/replay/segmentCollection/index.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segment.js +315 -10
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +957 -72
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/replay/startRecordBridge.js.map +1 -1
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/esm/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js +30 -12
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/esm/domain/tracing/ddtraceTracer.js.map +1 -1
- package/esm/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/esm/domain/tracing/jaegerTracer.js.map +1 -1
- package/esm/domain/tracing/sampler.js.map +1 -1
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/traceIdentifier.js.map +1 -1
- package/esm/domain/tracing/tracer.js +2 -2
- package/esm/domain/tracing/tracer.js.map +1 -1
- package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/esm/domain/trackEventCounts.js.map +1 -1
- package/esm/domain/usr/index.js.map +1 -1
- package/esm/domain/waitPageActivityEnd.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/transport/startRumBatch.js +4 -2
- package/esm/transport/startRumBatch.js.map +1 -1
- package/esm/transport/startRumEventBridge.js.map +1 -1
- package/esm/types/index.js.map +1 -1
- package/esm/types/sessionReplayConstants.js.map +1 -1
- package/package.json +12 -7
- package/src/boot/recorderApi.js +247 -220
- package/src/boot/recorderApiStub.js +3 -29
- package/src/boot/sessionReplayPublicApi.js +15 -28
- package/src/boot/startRecording.js +429 -146
- package/src/domain/assembly.js +5 -4
- package/src/domain/configuration.js +63 -100
- package/src/domain/contexts/urlContexts.js +16 -4
- package/src/domain/deflate/deflateEncoder.js +699 -43
- package/src/domain/deflate/deflateWorker.js +237 -136
- package/src/domain/replay/record/canvasCommandCapture.js +1374 -180
- package/src/domain/replay/record/canvasCommandObserver.js +1585 -150
- package/src/domain/replay/record/canvasCommandSerializeArgs.js +79 -42
- package/src/domain/replay/record/canvasContext.js +67 -0
- package/src/domain/replay/record/canvasContinuousScheduler.js +379 -143
- package/src/domain/replay/record/canvasEncodeBridge.js +691 -106
- package/src/domain/replay/record/canvasEncodeWorker.js +67 -43
- package/src/domain/replay/record/canvasFrameSignature.js +58 -24
- package/src/domain/replay/record/canvasObserver.js +461 -89
- package/src/domain/replay/record/canvasWebGLPluginHost.js +43 -0
- package/src/domain/replay/record/elementsScrollPositions.js +3 -0
- package/src/domain/replay/record/mutationBatch.js +761 -27
- package/src/domain/replay/record/mutationObserver.js +2992 -261
- package/src/domain/replay/record/mutationResourceBudget.js +191 -0
- package/src/domain/replay/record/observers.js +367 -97
- package/src/domain/replay/record/privacy.js +34 -12
- package/src/domain/replay/record/record.js +4284 -413
- package/src/domain/replay/record/serializationUtils.js +587 -28
- package/src/domain/replay/record/serialize.js +432 -66
- package/src/domain/replay/record/shadowRootsController.js +1108 -30
- package/src/domain/replay/segmentCollection/segment.js +441 -11
- package/src/domain/replay/segmentCollection/segmentCollection.js +1300 -77
- package/src/domain/rumEventsCollection/view/trackViews.js +36 -12
- package/src/domain/tracing/tracer.js +4 -5
- package/src/transport/startRumBatch.js +6 -1
- package/types/index.d.ts +15 -2
- package/cjs/domain/replay/record/canvasReplayFixtures.js +0 -105
- package/cjs/domain/replay/record/canvasReplayFixtures.js.map +0 -1
- package/esm/domain/replay/record/canvasReplayFixtures.js +0 -96
- package/esm/domain/replay/record/canvasReplayFixtures.js.map +0 -1
- package/src/domain/replay/record/canvasReplayFixtures.js +0 -113
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
RumEventType,
|
|
12
12
|
ActionType,
|
|
13
13
|
isNodeShadowHost,
|
|
14
|
-
cssEscape,
|
|
15
14
|
getScrollX,
|
|
16
15
|
getScrollY
|
|
17
16
|
} from '@cloudcare/browser-core'
|
|
@@ -32,7 +31,6 @@ import {
|
|
|
32
31
|
} from './serializationUtils'
|
|
33
32
|
import {
|
|
34
33
|
assembleIncrementalSnapshot,
|
|
35
|
-
forEach,
|
|
36
34
|
getPathToNestedCSSRule,
|
|
37
35
|
isTouchEvent
|
|
38
36
|
} from './utils'
|
|
@@ -45,6 +43,7 @@ import {
|
|
|
45
43
|
var MOUSE_MOVE_OBSERVER_THRESHOLD = 50
|
|
46
44
|
var SCROLL_OBSERVER_THRESHOLD = 100
|
|
47
45
|
var VISUAL_VIEWPORT_OBSERVER_THRESHOLD = 200
|
|
46
|
+
var MAX_TRACKED_RADIO_GROUPS = 256
|
|
48
47
|
|
|
49
48
|
var recordIds = new WeakMap()
|
|
50
49
|
let nextId = 1
|
|
@@ -56,49 +55,113 @@ export function getRecordIdForEvent(event) {
|
|
|
56
55
|
return recordIds.get(event)
|
|
57
56
|
}
|
|
58
57
|
export function initObservers(o) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
var cleanupTasks = []
|
|
59
|
+
var mutationHandler
|
|
60
|
+
var isNodeIgnoredForStateObserver = createNodeIgnorePredicate(
|
|
62
61
|
o.shadowRootsController,
|
|
63
|
-
o.
|
|
62
|
+
o.isNodeIgnored
|
|
64
63
|
)
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
o.
|
|
68
|
-
o.configuration
|
|
69
|
-
)
|
|
70
|
-
var scrollHandler = initScrollObserver(
|
|
71
|
-
o.scrollCb,
|
|
72
|
-
o.configuration,
|
|
73
|
-
o.elementsScrollPositions
|
|
74
|
-
)
|
|
75
|
-
var viewportResizeHandler = initViewportResizeObserver(
|
|
76
|
-
o.viewportResizeCb,
|
|
77
|
-
o.configuration
|
|
78
|
-
)
|
|
79
|
-
var inputHandler = initInputObserver(o.inputCb, o.configuration)
|
|
80
|
-
var mediaInteractionHandler = initMediaInteractionObserver(
|
|
81
|
-
o.mediaInteractionCb,
|
|
82
|
-
o.configuration
|
|
83
|
-
)
|
|
84
|
-
var styleSheetObserver = initStyleSheetObserver(
|
|
85
|
-
o.styleSheetCb,
|
|
86
|
-
o.configuration
|
|
87
|
-
)
|
|
88
|
-
var focusHandler = initFocusObserver(o.focusCb, o.configuration)
|
|
89
|
-
var visualViewportResizeHandler = initVisualViewportResizeObserver(
|
|
90
|
-
o.visualViewportResizeCb,
|
|
91
|
-
o.configuration
|
|
92
|
-
)
|
|
93
|
-
var frustrationHandler = initFrustrationObserver(
|
|
94
|
-
o.lifeCycle,
|
|
95
|
-
o.frustrationCb,
|
|
96
|
-
o.configuration
|
|
64
|
+
var isNodeIgnoredForStatelessObserver = createNodeIgnorePredicate(
|
|
65
|
+
o.shadowRootsController,
|
|
66
|
+
o.isNodeIgnoredForStatelessObserver || o.isNodeIgnored
|
|
97
67
|
)
|
|
68
|
+
try {
|
|
69
|
+
mutationHandler = initMutationObserver(
|
|
70
|
+
o.mutationCb,
|
|
71
|
+
o.configuration,
|
|
72
|
+
o.shadowRootsController,
|
|
73
|
+
o.mutationPerfCb,
|
|
74
|
+
o.mutationOverflowCb,
|
|
75
|
+
o.mutationActivityCb,
|
|
76
|
+
o.mutationNodeSerializationCb,
|
|
77
|
+
// DOM mutation assembly and stateful observers use the queued-aware
|
|
78
|
+
// predicate. Stateless interactions use the strict published-only
|
|
79
|
+
// predicate below and never advance a pending serializer.
|
|
80
|
+
o.isNodeIgnored &&
|
|
81
|
+
function (node) {
|
|
82
|
+
return o.isNodeIgnored(node, true)
|
|
83
|
+
},
|
|
84
|
+
o.isNodePublished,
|
|
85
|
+
o.mutationResourceBudget
|
|
86
|
+
)
|
|
87
|
+
cleanupTasks.push(mutationHandler.stop)
|
|
88
|
+
cleanupTasks.push(
|
|
89
|
+
initMoveObserver(
|
|
90
|
+
o.mousemoveCb,
|
|
91
|
+
o.configuration,
|
|
92
|
+
isNodeIgnoredForStatelessObserver
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
cleanupTasks.push(
|
|
96
|
+
initMouseInteractionObserver(
|
|
97
|
+
o.mouseInteractionCb,
|
|
98
|
+
o.configuration,
|
|
99
|
+
isNodeIgnoredForStatelessObserver
|
|
100
|
+
)
|
|
101
|
+
)
|
|
102
|
+
cleanupTasks.push(
|
|
103
|
+
initScrollObserver(
|
|
104
|
+
o.scrollCb,
|
|
105
|
+
o.configuration,
|
|
106
|
+
o.elementsScrollPositions,
|
|
107
|
+
isNodeIgnoredForStateObserver
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
cleanupTasks.push(
|
|
111
|
+
initViewportResizeObserver(o.viewportResizeCb, o.configuration)
|
|
112
|
+
)
|
|
113
|
+
cleanupTasks.push(
|
|
114
|
+
initInputObserver(
|
|
115
|
+
o.inputCb,
|
|
116
|
+
o.configuration,
|
|
117
|
+
undefined,
|
|
118
|
+
isNodeIgnoredForStateObserver
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
cleanupTasks.push(
|
|
122
|
+
initMediaInteractionObserver(
|
|
123
|
+
o.mediaInteractionCb,
|
|
124
|
+
o.configuration,
|
|
125
|
+
isNodeIgnoredForStateObserver
|
|
126
|
+
)
|
|
127
|
+
)
|
|
128
|
+
cleanupTasks.push(
|
|
129
|
+
initStyleSheetObserver(
|
|
130
|
+
o.styleSheetCb,
|
|
131
|
+
o.configuration,
|
|
132
|
+
isNodeIgnoredForStateObserver
|
|
133
|
+
)
|
|
134
|
+
)
|
|
135
|
+
cleanupTasks.push(initFocusObserver(o.focusCb, o.configuration))
|
|
136
|
+
cleanupTasks.push(
|
|
137
|
+
initVisualViewportResizeObserver(
|
|
138
|
+
o.visualViewportResizeCb,
|
|
139
|
+
o.configuration
|
|
140
|
+
)
|
|
141
|
+
)
|
|
142
|
+
cleanupTasks.push(
|
|
143
|
+
initFrustrationObserver(
|
|
144
|
+
o.lifeCycle,
|
|
145
|
+
o.frustrationCb,
|
|
146
|
+
o.configuration,
|
|
147
|
+
isNodeIgnoredForStatelessObserver
|
|
148
|
+
)
|
|
149
|
+
)
|
|
150
|
+
} catch (error) {
|
|
151
|
+
try {
|
|
152
|
+
runObserverCleanupTasks(cleanupTasks.slice().reverse())
|
|
153
|
+
} catch (_) {}
|
|
154
|
+
throw error
|
|
155
|
+
}
|
|
98
156
|
|
|
99
157
|
return {
|
|
100
158
|
flush: function () {
|
|
101
|
-
mutationHandler.flush()
|
|
159
|
+
return mutationHandler.flush()
|
|
160
|
+
},
|
|
161
|
+
refreshAndFlushPendingRootForNode: function (node) {
|
|
162
|
+
if (mutationHandler.refreshAndFlushPendingRootForNode) {
|
|
163
|
+
return mutationHandler.refreshAndFlushPendingRootForNode(node)
|
|
164
|
+
}
|
|
102
165
|
},
|
|
103
166
|
reset: function () {
|
|
104
167
|
if (mutationHandler.reset) {
|
|
@@ -106,41 +169,95 @@ export function initObservers(o) {
|
|
|
106
169
|
}
|
|
107
170
|
},
|
|
108
171
|
stop: function () {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
172
|
+
runObserverCleanupTasks(cleanupTasks)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function createNodeIgnorePredicate(
|
|
178
|
+
shadowRootsController,
|
|
179
|
+
customIsNodeIgnored
|
|
180
|
+
) {
|
|
181
|
+
if (typeof customIsNodeIgnored === 'function') {
|
|
182
|
+
return function (node) {
|
|
183
|
+
try {
|
|
184
|
+
return customIsNodeIgnored(node)
|
|
185
|
+
} catch (_) {
|
|
186
|
+
return true
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
if (
|
|
191
|
+
!shadowRootsController ||
|
|
192
|
+
typeof shadowRootsController.isNodeInSkippedShadowRoot !== 'function'
|
|
193
|
+
) {
|
|
194
|
+
return function () {
|
|
195
|
+
return false
|
|
120
196
|
}
|
|
121
197
|
}
|
|
198
|
+
return function (node) {
|
|
199
|
+
try {
|
|
200
|
+
return shadowRootsController.isNodeInSkippedShadowRoot(node)
|
|
201
|
+
} catch (_) {
|
|
202
|
+
return true
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function neverIgnoreNode() {
|
|
208
|
+
return false
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function runObserverCleanupTasks(tasks) {
|
|
212
|
+
var firstError
|
|
213
|
+
tasks.forEach(function (task) {
|
|
214
|
+
try {
|
|
215
|
+
task()
|
|
216
|
+
} catch (error) {
|
|
217
|
+
if (!firstError) {
|
|
218
|
+
firstError = error
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
if (firstError) {
|
|
223
|
+
throw firstError
|
|
224
|
+
}
|
|
122
225
|
}
|
|
123
226
|
|
|
124
227
|
export function initMutationObserver(
|
|
125
228
|
cb,
|
|
126
229
|
configuration,
|
|
127
230
|
shadowRootsController,
|
|
128
|
-
mutationPerfCb
|
|
231
|
+
mutationPerfCb,
|
|
232
|
+
mutationOverflowCb,
|
|
233
|
+
mutationActivityCb,
|
|
234
|
+
mutationNodeSerializationCb,
|
|
235
|
+
isNodeIgnored,
|
|
236
|
+
isNodePublished,
|
|
237
|
+
mutationResourceBudget
|
|
129
238
|
) {
|
|
130
239
|
return startMutationObserver(
|
|
131
240
|
cb,
|
|
132
241
|
configuration,
|
|
133
242
|
shadowRootsController,
|
|
134
243
|
document,
|
|
135
|
-
mutationPerfCb
|
|
244
|
+
mutationPerfCb,
|
|
245
|
+
mutationOverflowCb,
|
|
246
|
+
mutationActivityCb,
|
|
247
|
+
mutationNodeSerializationCb,
|
|
248
|
+
isNodeIgnored,
|
|
249
|
+
isNodePublished,
|
|
250
|
+
undefined,
|
|
251
|
+
mutationResourceBudget
|
|
136
252
|
)
|
|
137
253
|
}
|
|
138
254
|
|
|
139
|
-
export function initMoveObserver(cb, configuration) {
|
|
255
|
+
export function initMoveObserver(cb, configuration, isNodeIgnored) {
|
|
256
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
140
257
|
var _updatePosition = throttle(
|
|
141
258
|
function (event) {
|
|
142
259
|
var target = getEventTarget(event)
|
|
143
|
-
if (hasSerializedNode(target)) {
|
|
260
|
+
if (!isNodeIgnored(target) && hasSerializedNode(target)) {
|
|
144
261
|
var coordinates = tryToComputeCoordinates(event)
|
|
145
262
|
if (!coordinates) {
|
|
146
263
|
return
|
|
@@ -184,30 +301,36 @@ export function initMoveObserver(cb, configuration) {
|
|
|
184
301
|
}
|
|
185
302
|
}
|
|
186
303
|
|
|
187
|
-
var eventTypeToMouseInteraction = {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
export function initMouseInteractionObserver(
|
|
304
|
+
var eventTypeToMouseInteraction = {}
|
|
305
|
+
// Listen for pointerup DOM events instead of mouseup for MouseInteraction/MouseUp records. This
|
|
306
|
+
// allows to reference such records from Frustration records.
|
|
307
|
+
//
|
|
308
|
+
// In the context of supporting Mobile Session Replay, we introduced `PointerInteraction` records
|
|
309
|
+
// used by the Mobile SDKs in place of `MouseInteraction`. In the future, we should replace
|
|
310
|
+
// `MouseInteraction` by `PointerInteraction` in the Browser SDK so we have an uniform way to
|
|
311
|
+
// convey such interaction. This would cleanly solve the issue since we would have
|
|
312
|
+
// `PointerInteraction/Up` records that we could reference from `Frustration` records.
|
|
313
|
+
eventTypeToMouseInteraction[DOM_EVENT.POINTER_UP] = MouseInteractionType.MouseUp
|
|
314
|
+
eventTypeToMouseInteraction[DOM_EVENT.MOUSE_DOWN] = MouseInteractionType.MouseDown
|
|
315
|
+
eventTypeToMouseInteraction[DOM_EVENT.CLICK] = MouseInteractionType.Click
|
|
316
|
+
eventTypeToMouseInteraction[DOM_EVENT.CONTEXT_MENU] =
|
|
317
|
+
MouseInteractionType.ContextMenu
|
|
318
|
+
eventTypeToMouseInteraction[DOM_EVENT.DBL_CLICK] = MouseInteractionType.DblClick
|
|
319
|
+
eventTypeToMouseInteraction[DOM_EVENT.FOCUS] = MouseInteractionType.Focus
|
|
320
|
+
eventTypeToMouseInteraction[DOM_EVENT.BLUR] = MouseInteractionType.Blur
|
|
321
|
+
eventTypeToMouseInteraction[DOM_EVENT.TOUCH_START] =
|
|
322
|
+
MouseInteractionType.TouchStart
|
|
323
|
+
eventTypeToMouseInteraction[DOM_EVENT.TOUCH_END] = MouseInteractionType.TouchEnd
|
|
324
|
+
export function initMouseInteractionObserver(
|
|
325
|
+
cb,
|
|
326
|
+
configuration,
|
|
327
|
+
isNodeIgnored
|
|
328
|
+
) {
|
|
329
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
208
330
|
var handler = function (event) {
|
|
209
331
|
var target = getEventTarget(event)
|
|
210
332
|
if (
|
|
333
|
+
isNodeIgnored(target) ||
|
|
211
334
|
getNodePrivacyLevel(target, configuration.defaultPrivacyLevel) ===
|
|
212
335
|
NodePrivacyLevel.HIDDEN ||
|
|
213
336
|
!hasSerializedNode(target)
|
|
@@ -267,11 +390,20 @@ function tryToComputeCoordinates(event) {
|
|
|
267
390
|
return { x: x, y: y }
|
|
268
391
|
}
|
|
269
392
|
|
|
270
|
-
function initScrollObserver(
|
|
393
|
+
function initScrollObserver(
|
|
394
|
+
cb,
|
|
395
|
+
configuration,
|
|
396
|
+
elementsScrollPositions,
|
|
397
|
+
isNodeIgnored
|
|
398
|
+
) {
|
|
399
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
271
400
|
var _updatePosition = throttle(function (event) {
|
|
272
401
|
var target = getEventTarget(event)
|
|
402
|
+
if (!target) {
|
|
403
|
+
return
|
|
404
|
+
}
|
|
405
|
+
var ignored = isNodeIgnored(target)
|
|
273
406
|
if (
|
|
274
|
-
!target ||
|
|
275
407
|
getNodePrivacyLevel(target, configuration.defaultPrivacyLevel) ===
|
|
276
408
|
NodePrivacyLevel.HIDDEN ||
|
|
277
409
|
!hasSerializedNode(target)
|
|
@@ -290,6 +422,11 @@ function initScrollObserver(cb, configuration, elementsScrollPositions) {
|
|
|
290
422
|
scrollLeft: Math.round(target.scrollLeft)
|
|
291
423
|
}
|
|
292
424
|
elementsScrollPositions.set(target, scrollPositions)
|
|
425
|
+
if (ignored) {
|
|
426
|
+
// Keep the live scroll baseline current while a time-sliced full
|
|
427
|
+
// snapshot temporarily gates incremental records.
|
|
428
|
+
return
|
|
429
|
+
}
|
|
293
430
|
cb({
|
|
294
431
|
id: id,
|
|
295
432
|
x: scrollPositions.scrollLeft,
|
|
@@ -314,11 +451,18 @@ function initViewportResizeObserver(cb, configuration) {
|
|
|
314
451
|
return initViewportObservable().subscribe(cb).unsubscribe
|
|
315
452
|
}
|
|
316
453
|
|
|
317
|
-
export function initInputObserver(
|
|
454
|
+
export function initInputObserver(
|
|
455
|
+
cb,
|
|
456
|
+
configuration,
|
|
457
|
+
target,
|
|
458
|
+
isNodeIgnored
|
|
459
|
+
) {
|
|
318
460
|
if (target === undefined) {
|
|
319
461
|
target = document
|
|
320
462
|
}
|
|
463
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
321
464
|
var lastInputStateMap = new WeakMap()
|
|
465
|
+
var radioGroupStateByRoot = new WeakMap()
|
|
322
466
|
var isShadowRoot = target !== document
|
|
323
467
|
|
|
324
468
|
var _addEventListeners = addEventListeners(
|
|
@@ -371,6 +515,9 @@ export function initInputObserver(cb, configuration, target) {
|
|
|
371
515
|
}
|
|
372
516
|
|
|
373
517
|
function onElementChange(target) {
|
|
518
|
+
if (isNodeIgnored(target)) {
|
|
519
|
+
return
|
|
520
|
+
}
|
|
374
521
|
var nodePrivacyLevel = getNodePrivacyLevel(
|
|
375
522
|
target,
|
|
376
523
|
configuration.defaultPrivacyLevel
|
|
@@ -396,30 +543,125 @@ export function initInputObserver(cb, configuration, target) {
|
|
|
396
543
|
}
|
|
397
544
|
|
|
398
545
|
// Can be multiple changes on the same node within the same batched mutation observation.
|
|
399
|
-
cbWithDedup(target, inputState)
|
|
546
|
+
var shouldTrackRadioGroup = cbWithDedup(target, inputState)
|
|
400
547
|
|
|
401
548
|
// If a radio was checked, other radios with the same name attribute will be unchecked.
|
|
549
|
+
// Keep only the last observed checked radio per native group. This avoids
|
|
550
|
+
// scanning an arbitrarily large document and does not manufacture false
|
|
551
|
+
// records for every unchecked peer when a group is first observed.
|
|
552
|
+
if (type === 'radio' && target.name && shouldTrackRadioGroup) {
|
|
553
|
+
synchronizeRadioGroup(target)
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function synchronizeRadioGroup(target) {
|
|
558
|
+
var root = getRadioRoot(target)
|
|
559
|
+
var groupMap = getRadioGroupMap(root, target.form)
|
|
402
560
|
var name = target.name
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
561
|
+
var previouslyCheckedRadio = getTrackedRadio(
|
|
562
|
+
groupMap,
|
|
563
|
+
name,
|
|
564
|
+
target,
|
|
565
|
+
root
|
|
566
|
+
)
|
|
567
|
+
|
|
568
|
+
if (!target.checked) {
|
|
569
|
+
if (previouslyCheckedRadio === target) {
|
|
570
|
+
groupMap.delete(name)
|
|
571
|
+
}
|
|
572
|
+
return
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
trackRadio(groupMap, name, target)
|
|
576
|
+
if (
|
|
577
|
+
previouslyCheckedRadio &&
|
|
578
|
+
previouslyCheckedRadio !== target &&
|
|
579
|
+
isInSameRadioGroup(previouslyCheckedRadio, target, root) &&
|
|
580
|
+
!previouslyCheckedRadio.checked
|
|
581
|
+
) {
|
|
582
|
+
cbWithDedup(previouslyCheckedRadio, { isChecked: false })
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function getTrackedRadio(groupMap, name, target, root) {
|
|
587
|
+
var reference = groupMap.get(name)
|
|
588
|
+
if (!reference) {
|
|
589
|
+
return undefined
|
|
590
|
+
}
|
|
591
|
+
var radio = reference.weakRef
|
|
592
|
+
? reference.weakRef.deref()
|
|
593
|
+
: reference.radio
|
|
594
|
+
if (
|
|
595
|
+
!radio ||
|
|
596
|
+
!radio.isConnected ||
|
|
597
|
+
!isInSameRadioGroup(radio, target, root)
|
|
598
|
+
) {
|
|
599
|
+
groupMap.delete(name)
|
|
600
|
+
return undefined
|
|
601
|
+
}
|
|
602
|
+
return radio
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function trackRadio(groupMap, name, radio) {
|
|
606
|
+
if (groupMap.has(name)) {
|
|
607
|
+
groupMap.delete(name)
|
|
608
|
+
}
|
|
609
|
+
groupMap.set(
|
|
610
|
+
name,
|
|
611
|
+
typeof WeakRef === 'function'
|
|
612
|
+
? { weakRef: new WeakRef(radio) }
|
|
613
|
+
: { radio: radio }
|
|
614
|
+
)
|
|
615
|
+
if (groupMap.size > MAX_TRACKED_RADIO_GROUPS) {
|
|
616
|
+
groupMap.delete(groupMap.keys().next().value)
|
|
414
617
|
}
|
|
415
618
|
}
|
|
416
619
|
|
|
620
|
+
function getRadioGroupMap(root, form) {
|
|
621
|
+
var rootState = radioGroupStateByRoot.get(root)
|
|
622
|
+
if (!rootState) {
|
|
623
|
+
rootState = {
|
|
624
|
+
groupsWithoutForm: new Map(),
|
|
625
|
+
groupsByForm: new WeakMap()
|
|
626
|
+
}
|
|
627
|
+
radioGroupStateByRoot.set(root, rootState)
|
|
628
|
+
}
|
|
629
|
+
if (!form) {
|
|
630
|
+
return rootState.groupsWithoutForm
|
|
631
|
+
}
|
|
632
|
+
var formGroups = rootState.groupsByForm.get(form)
|
|
633
|
+
if (!formGroups) {
|
|
634
|
+
formGroups = new Map()
|
|
635
|
+
rootState.groupsByForm.set(form, formGroups)
|
|
636
|
+
}
|
|
637
|
+
return formGroups
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function getRadioRoot(input) {
|
|
641
|
+
if (typeof input.getRootNode === 'function') {
|
|
642
|
+
var root = input.getRootNode()
|
|
643
|
+
if (root) {
|
|
644
|
+
return root
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return input.ownerDocument || document
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
function isInSameRadioGroup(candidate, target, root) {
|
|
651
|
+
return (
|
|
652
|
+
candidate.type === 'radio' &&
|
|
653
|
+
candidate.name === target.name &&
|
|
654
|
+
candidate.form === target.form &&
|
|
655
|
+
getRadioRoot(candidate) === root
|
|
656
|
+
)
|
|
657
|
+
}
|
|
658
|
+
|
|
417
659
|
/**
|
|
418
660
|
* There can be multiple changes on the same node within the same batched mutation observation.
|
|
419
661
|
*/
|
|
420
662
|
function cbWithDedup(target, inputState) {
|
|
421
|
-
if (!hasSerializedNode(target)) {
|
|
422
|
-
return
|
|
663
|
+
if (isNodeIgnored(target) || !hasSerializedNode(target)) {
|
|
664
|
+
return false
|
|
423
665
|
}
|
|
424
666
|
var lastInputState = lastInputStateMap.get(target)
|
|
425
667
|
if (
|
|
@@ -437,12 +679,22 @@ export function initInputObserver(cb, configuration, target) {
|
|
|
437
679
|
)
|
|
438
680
|
)
|
|
439
681
|
}
|
|
682
|
+
return true
|
|
440
683
|
}
|
|
441
684
|
}
|
|
442
685
|
|
|
443
|
-
export function initStyleSheetObserver(
|
|
686
|
+
export function initStyleSheetObserver(
|
|
687
|
+
cb,
|
|
688
|
+
configuration,
|
|
689
|
+
isNodeIgnored
|
|
690
|
+
) {
|
|
691
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
444
692
|
function checkStyleSheetAndCallback(styleSheet, callback) {
|
|
445
|
-
if (
|
|
693
|
+
if (
|
|
694
|
+
styleSheet &&
|
|
695
|
+
!isNodeIgnored(styleSheet.ownerNode) &&
|
|
696
|
+
hasSerializedNode(styleSheet.ownerNode)
|
|
697
|
+
) {
|
|
446
698
|
callback(getSerializedNodeId(styleSheet.ownerNode))
|
|
447
699
|
}
|
|
448
700
|
}
|
|
@@ -511,11 +763,17 @@ export function initStyleSheetObserver(cb, configuration) {
|
|
|
511
763
|
}
|
|
512
764
|
}
|
|
513
765
|
|
|
514
|
-
function initMediaInteractionObserver(
|
|
766
|
+
function initMediaInteractionObserver(
|
|
767
|
+
mediaInteractionCb,
|
|
768
|
+
configuration,
|
|
769
|
+
isNodeIgnored
|
|
770
|
+
) {
|
|
771
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
515
772
|
var handler = function (event) {
|
|
516
773
|
var target = getEventTarget(event)
|
|
517
774
|
if (
|
|
518
775
|
!target ||
|
|
776
|
+
isNodeIgnored(target) ||
|
|
519
777
|
getNodePrivacyLevel(target, configuration.defaultPrivacyLevel) ===
|
|
520
778
|
NodePrivacyLevel.HIDDEN ||
|
|
521
779
|
!hasSerializedNode(target)
|
|
@@ -580,8 +838,10 @@ function initVisualViewportResizeObserver(cb, configuration) {
|
|
|
580
838
|
export function initFrustrationObserver(
|
|
581
839
|
lifeCycle,
|
|
582
840
|
frustrationCb,
|
|
583
|
-
configuration
|
|
841
|
+
configuration,
|
|
842
|
+
isNodeIgnored
|
|
584
843
|
) {
|
|
844
|
+
isNodeIgnored = isNodeIgnored || neverIgnoreNode
|
|
585
845
|
return lifeCycle.subscribe(
|
|
586
846
|
LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,
|
|
587
847
|
function (data) {
|
|
@@ -595,12 +855,22 @@ export function initFrustrationObserver(
|
|
|
595
855
|
data.domainContext.events &&
|
|
596
856
|
data.domainContext.events.length
|
|
597
857
|
) {
|
|
858
|
+
var replayEvents = data.domainContext.events.filter(function (event) {
|
|
859
|
+
try {
|
|
860
|
+
return !isNodeIgnored(getEventTarget(event))
|
|
861
|
+
} catch (_) {
|
|
862
|
+
return false
|
|
863
|
+
}
|
|
864
|
+
})
|
|
865
|
+
if (!replayEvents.length) {
|
|
866
|
+
return
|
|
867
|
+
}
|
|
598
868
|
frustrationCb({
|
|
599
869
|
timestamp: data.rawRumEvent.date,
|
|
600
870
|
type: RecordType.FrustrationRecord,
|
|
601
871
|
data: {
|
|
602
872
|
frustrationTypes: data.rawRumEvent.action.frustration.type,
|
|
603
|
-
recordIds:
|
|
873
|
+
recordIds: replayEvents.map(function (e) {
|
|
604
874
|
return getRecordIdForEvent(e)
|
|
605
875
|
})
|
|
606
876
|
}
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
export var MAX_ATTRIBUTE_VALUE_CHAR_LENGTH = 100_000
|
|
23
23
|
|
|
24
24
|
var TEXT_MASKING_CHAR = 'x'
|
|
25
|
+
export var MAX_PRIVACY_ANCESTOR_DEPTH = 1000
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Get node privacy level by iterating over its ancestors. When the direct parent privacy level is
|
|
@@ -33,19 +34,40 @@ export function getNodePrivacyLevel(node, defaultPrivacyLevel, cache) {
|
|
|
33
34
|
if (cache && cache.has(node)) {
|
|
34
35
|
return cache.get(node)
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
|
|
38
|
+
// Resolve ancestors iteratively so an adversarially deep DOM cannot grow the
|
|
39
|
+
// JavaScript stack. If the watermark is crossed, fail closed: hiding the
|
|
40
|
+
// branch is safer than spending unbounded time resolving its privacy chain.
|
|
41
|
+
var unresolvedNodes = []
|
|
42
|
+
var currentNode = node
|
|
43
|
+
var inheritedPrivacyLevel
|
|
44
|
+
while (currentNode) {
|
|
45
|
+
if (cache && cache.has(currentNode)) {
|
|
46
|
+
inheritedPrivacyLevel = cache.get(currentNode)
|
|
47
|
+
break
|
|
48
|
+
}
|
|
49
|
+
if (unresolvedNodes.length >= MAX_PRIVACY_ANCESTOR_DEPTH) {
|
|
50
|
+
inheritedPrivacyLevel = NodePrivacyLevel.HIDDEN
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
unresolvedNodes.push(currentNode)
|
|
54
|
+
currentNode = getParentNode(currentNode)
|
|
55
|
+
}
|
|
56
|
+
if (inheritedPrivacyLevel === undefined) {
|
|
57
|
+
inheritedPrivacyLevel = defaultPrivacyLevel
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
while (unresolvedNodes.length) {
|
|
61
|
+
var unresolvedNode = unresolvedNodes.pop()
|
|
62
|
+
inheritedPrivacyLevel = reducePrivacyLevel(
|
|
63
|
+
getNodeSelfPrivacyLevel(unresolvedNode),
|
|
64
|
+
inheritedPrivacyLevel
|
|
65
|
+
)
|
|
66
|
+
if (cache) {
|
|
67
|
+
cache.set(unresolvedNode, inheritedPrivacyLevel)
|
|
68
|
+
}
|
|
47
69
|
}
|
|
48
|
-
return
|
|
70
|
+
return inheritedPrivacyLevel
|
|
49
71
|
}
|
|
50
72
|
|
|
51
73
|
/**
|