File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/rum-core/src/domain Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ function getActionNameFromStandardAttribute(
179179 const attributeValue = element . getAttribute ( attribute )
180180 return {
181181 name :
182- enablePrivacyForActionName && shouldMaskNode ( element , nodeSelfPrivacyLevel )
182+ enablePrivacyForActionName && nodeSelfPrivacyLevel && shouldMaskNode ( element , nodeSelfPrivacyLevel , false )
183183 ? maskDisallowedTextContent ( attributeValue || '' , ACTION_NAME_PLACEHOLDER )
184184 : attributeValue || '' ,
185185 nameSource : ActionNameSource . STANDARD_ATTRIBUTE ,
Original file line number Diff line number Diff line change @@ -128,13 +128,14 @@ export function getNodeSelfPrivacyLevel(node: Node): NodePrivacyLevel | undefine
128128 * Other `shouldMaskNode` cases are edge cases that should not matter too much (ex: should we mask a
129129 * node if it is ignored or hidden? it doesn't matter since it won't be serialized).
130130 */
131- export function shouldMaskNode ( node : Node , privacyLevel : NodePrivacyLevel ) {
131+ export function shouldMaskNode ( node : Node , privacyLevel : NodePrivacyLevel , isTextContent : boolean = true ) {
132132 switch ( privacyLevel ) {
133133 case NodePrivacyLevel . MASK :
134134 case NodePrivacyLevel . HIDDEN :
135135 case NodePrivacyLevel . IGNORE :
136136 return true
137137 case NodePrivacyLevel . MASK_UNLESS_ALLOWLISTED :
138+ if ( ! isTextContent ) return true
138139 if ( isTextNode ( node ) ) {
139140 // Always return true if our parent is a form element, like MASK_USER_INPUT.
140141 // Otherwise, decide whether to mask based on the allowlist.
You can’t perform that action at this time.
0 commit comments