@sentry/replay 10.76.2 → 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.
@@ -4962,7 +4962,7 @@ const handleDomListener = (replay) => {
4962
4962
  if (!replay.isEnabled()) {
4963
4963
  return;
4964
4964
  }
4965
- const result = handleDom(handlerData);
4965
+ const result = handleDom(handlerData, replay.getMaskAttributeFn());
4966
4966
  if (!result) {
4967
4967
  return;
4968
4968
  }
@@ -4996,20 +4996,20 @@ function getBaseDomBreadcrumb(target, message) {
4996
4996
  } : {}
4997
4997
  };
4998
4998
  }
4999
- function handleDom(handlerData) {
5000
- const { target, message } = getDomTarget(handlerData);
4999
+ function handleDom(handlerData, maskAttributeFn) {
5000
+ const { target, message } = getDomTarget(handlerData, maskAttributeFn);
5001
5001
  return createBreadcrumb({
5002
5002
  category: `ui.${handlerData.name}`,
5003
5003
  ...getBaseDomBreadcrumb(target, message)
5004
5004
  });
5005
5005
  }
5006
- function getDomTarget(handlerData) {
5006
+ function getDomTarget(handlerData, maskAttributeFn) {
5007
5007
  const isClick = handlerData.name === "click";
5008
5008
  let message;
5009
5009
  let target = null;
5010
5010
  try {
5011
5011
  target = isClick ? getClickTargetNode(handlerData.event) : getTargetNode(handlerData.event);
5012
- message = browserUtils.htmlTreeAsString(target, { maxStringLength: 200 }) || "<unknown>";
5012
+ message = browserUtils.htmlTreeAsString(target, { maxStringLength: 200, maskAttributeFn }) || "<unknown>";
5013
5013
  } catch {
5014
5014
  message = "<unknown>";
5015
5015
  }
@@ -5024,13 +5024,13 @@ function handleKeyboardEvent(replay, event) {
5024
5024
  return;
5025
5025
  }
5026
5026
  replay.updateUserActivity();
5027
- const breadcrumb = getKeyboardBreadcrumb(event);
5027
+ const breadcrumb = getKeyboardBreadcrumb(event, replay.getMaskAttributeFn());
5028
5028
  if (!breadcrumb) {
5029
5029
  return;
5030
5030
  }
5031
5031
  addBreadcrumbEvent(replay, breadcrumb);
5032
5032
  }
5033
- function getKeyboardBreadcrumb(event) {
5033
+ function getKeyboardBreadcrumb(event, maskAttributeFn) {
5034
5034
  const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event;
5035
5035
  if (!target || isInputElement(target) || !key) {
5036
5036
  return null;
@@ -5040,7 +5040,7 @@ function getKeyboardBreadcrumb(event) {
5040
5040
  if (!hasModifierKey && isCharacterKey) {
5041
5041
  return null;
5042
5042
  }
5043
- const message = browserUtils.htmlTreeAsString(target, { maxStringLength: 200 }) || "<unknown>";
5043
+ const message = browserUtils.htmlTreeAsString(target, { maxStringLength: 200, maskAttributeFn }) || "<unknown>";
5044
5044
  const baseBreadcrumb = getBaseDomBreadcrumb(target, message);
5045
5045
  return createBreadcrumb({
5046
5046
  category: "ui.keyDown",
@@ -7330,6 +7330,9 @@ class ReplayContainer {
7330
7330
  getOptions() {
7331
7331
  return this._options;
7332
7332
  }
7333
+ getMaskAttributeFn() {
7334
+ return this._recordingOptions.maskAttributeFn;
7335
+ }
7333
7336
  /** A wrapper to conditionally capture exceptions. */
7334
7337
  handleException(error) {
7335
7338
  DEBUG_BUILD && debug.exception(error);