File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed
browser-integration-tests/suites/replay/customEvents Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ sentryTest(
117
117
nodeId : expect . any ( Number ) ,
118
118
node : {
119
119
attributes : {
120
- 'aria-label' : '** ***** ** ********** ' ,
120
+ 'aria-label' : 'An Error in aria-label ' ,
121
121
class : 'btn btn-error' ,
122
122
id : 'error' ,
123
123
role : 'button' ,
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ export class Replay implements Integration {
81
81
networkResponseHeaders = [ ] ,
82
82
83
83
mask = [ ] ,
84
+ maskAttributes = [ 'title' , 'placeholder' ] ,
84
85
unmask = [ ] ,
85
86
block = [ ] ,
86
87
unblock = [ ] ,
@@ -110,6 +111,14 @@ export class Replay implements Integration {
110
111
maskInputOptions : { ...( maskInputOptions || { } ) , password : true } ,
111
112
maskTextFn : maskFn ,
112
113
maskInputFn : maskFn ,
114
+ maskAttributeFn : ( key : string , value : string ) : string => {
115
+ // For now, always mask these attributes
116
+ if ( maskAttributes . includes ( key ) ) {
117
+ return value . replace ( / [ \S ] / g, '*' ) ;
118
+ }
119
+
120
+ return value ;
121
+ } ,
113
122
114
123
...getPrivacyOptions ( {
115
124
mask,
Original file line number Diff line number Diff line change @@ -264,7 +264,12 @@ export interface ReplayIntegrationPrivacyOptions {
264
264
}
265
265
266
266
// These are optional for ReplayPluginOptions because the plugin sets default values
267
- type OptionalReplayPluginOptions = Partial < ReplayPluginOptions > ;
267
+ type OptionalReplayPluginOptions = Partial < ReplayPluginOptions > & {
268
+ /**
269
+ * Mask element attributes that are contained in list
270
+ */
271
+ maskAttributes ?: string [ ] ;
272
+ } ;
268
273
269
274
export interface DeprecatedPrivacyOptions {
270
275
/**
@@ -288,7 +293,7 @@ export interface DeprecatedPrivacyOptions {
288
293
*/
289
294
maskTextClass ?: RecordingOptions [ 'maskTextClass' ] ;
290
295
/**
291
- * @deprecated Use `mask` which accepts an array of CSS selectors
296
+ * @derecated Use `mask` which accepts an array of CSS selectors
292
297
*/
293
298
maskTextSelector ?: RecordingOptions [ 'maskTextSelector' ] ;
294
299
}
You can’t perform that action at this time.
0 commit comments