@sentry/replay 10.76.1 → 10.77.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/build/npm/cjs/index.js +11 -8
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/esm/index.js +11 -8
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/types/coreHandlers/handleDom.d.ts +2 -2
- package/build/npm/types/coreHandlers/handleDom.d.ts.map +1 -1
- package/build/npm/types/coreHandlers/handleKeyboardEvent.d.ts +2 -2
- package/build/npm/types/coreHandlers/handleKeyboardEvent.d.ts.map +1 -1
- package/build/npm/types/replay.d.ts +1 -0
- package/build/npm/types/replay.d.ts.map +1 -1
- package/build/npm/types/types/replay.d.ts +1 -0
- package/build/npm/types/types/replay.d.ts.map +1 -1
- package/build/npm/types/types/rrweb.d.ts +1 -0
- package/build/npm/types/types/rrweb.d.ts.map +1 -1
- package/build/npm/types-ts3.8/coreHandlers/handleDom.d.ts +2 -2
- package/build/npm/types-ts3.8/coreHandlers/handleKeyboardEvent.d.ts +2 -2
- package/build/npm/types-ts3.8/replay.d.ts +1 -0
- package/build/npm/types-ts3.8/types/replay.d.ts +1 -0
- package/build/npm/types-ts3.8/types/rrweb.d.ts +1 -0
- package/package.json +4 -4
package/build/npm/esm/index.js
CHANGED
|
@@ -4960,7 +4960,7 @@ const handleDomListener = (replay) => {
|
|
|
4960
4960
|
if (!replay.isEnabled()) {
|
|
4961
4961
|
return;
|
|
4962
4962
|
}
|
|
4963
|
-
const result = handleDom(handlerData);
|
|
4963
|
+
const result = handleDom(handlerData, replay.getMaskAttributeFn());
|
|
4964
4964
|
if (!result) {
|
|
4965
4965
|
return;
|
|
4966
4966
|
}
|
|
@@ -4994,20 +4994,20 @@ function getBaseDomBreadcrumb(target, message) {
|
|
|
4994
4994
|
} : {}
|
|
4995
4995
|
};
|
|
4996
4996
|
}
|
|
4997
|
-
function handleDom(handlerData) {
|
|
4998
|
-
const { target, message } = getDomTarget(handlerData);
|
|
4997
|
+
function handleDom(handlerData, maskAttributeFn) {
|
|
4998
|
+
const { target, message } = getDomTarget(handlerData, maskAttributeFn);
|
|
4999
4999
|
return createBreadcrumb({
|
|
5000
5000
|
category: `ui.${handlerData.name}`,
|
|
5001
5001
|
...getBaseDomBreadcrumb(target, message)
|
|
5002
5002
|
});
|
|
5003
5003
|
}
|
|
5004
|
-
function getDomTarget(handlerData) {
|
|
5004
|
+
function getDomTarget(handlerData, maskAttributeFn) {
|
|
5005
5005
|
const isClick = handlerData.name === "click";
|
|
5006
5006
|
let message;
|
|
5007
5007
|
let target = null;
|
|
5008
5008
|
try {
|
|
5009
5009
|
target = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event);
|
|
5010
|
-
message = htmlTreeAsString(target, { maxStringLength: 200 }) || "<unknown>";
|
|
5010
|
+
message = htmlTreeAsString(target, { maxStringLength: 200, maskAttributeFn }) || "<unknown>";
|
|
5011
5011
|
} catch {
|
|
5012
5012
|
message = "<unknown>";
|
|
5013
5013
|
}
|
|
@@ -5022,13 +5022,13 @@ function handleKeyboardEvent(replay, event) {
|
|
|
5022
5022
|
return;
|
|
5023
5023
|
}
|
|
5024
5024
|
replay.updateUserActivity();
|
|
5025
|
-
const breadcrumb = getKeyboardBreadcrumb(event);
|
|
5025
|
+
const breadcrumb = getKeyboardBreadcrumb(event, replay.getMaskAttributeFn());
|
|
5026
5026
|
if (!breadcrumb) {
|
|
5027
5027
|
return;
|
|
5028
5028
|
}
|
|
5029
5029
|
addBreadcrumbEvent(replay, breadcrumb);
|
|
5030
5030
|
}
|
|
5031
|
-
function getKeyboardBreadcrumb(event) {
|
|
5031
|
+
function getKeyboardBreadcrumb(event, maskAttributeFn) {
|
|
5032
5032
|
const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event;
|
|
5033
5033
|
if (!target || isInputElement(target) || !key) {
|
|
5034
5034
|
return null;
|
|
@@ -5038,7 +5038,7 @@ function getKeyboardBreadcrumb(event) {
|
|
|
5038
5038
|
if (!hasModifierKey && isCharacterKey) {
|
|
5039
5039
|
return null;
|
|
5040
5040
|
}
|
|
5041
|
-
const message = htmlTreeAsString(target, { maxStringLength: 200 }) || "<unknown>";
|
|
5041
|
+
const message = htmlTreeAsString(target, { maxStringLength: 200, maskAttributeFn }) || "<unknown>";
|
|
5042
5042
|
const baseBreadcrumb = getBaseDomBreadcrumb(target, message);
|
|
5043
5043
|
return createBreadcrumb({
|
|
5044
5044
|
category: "ui.keyDown",
|
|
@@ -7328,6 +7328,9 @@ class ReplayContainer {
|
|
|
7328
7328
|
getOptions() {
|
|
7329
7329
|
return this._options;
|
|
7330
7330
|
}
|
|
7331
|
+
getMaskAttributeFn() {
|
|
7332
|
+
return this._recordingOptions.maskAttributeFn;
|
|
7333
|
+
}
|
|
7331
7334
|
/** A wrapper to conditionally capture exceptions. */
|
|
7332
7335
|
handleException(error) {
|
|
7333
7336
|
DEBUG_BUILD && debug.exception(error);
|