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 @@ -79,6 +79,7 @@ export class Replay implements Integration {
79
79
networkResponseHeaders = [ ] ,
80
80
81
81
mask = [ ] ,
82
+ maskAttributes = [ 'title' , 'placeholder' ] ,
82
83
unmask = [ ] ,
83
84
block = [ ] ,
84
85
unblock = [ ] ,
@@ -108,6 +109,14 @@ export class Replay implements Integration {
108
109
maskInputOptions : { ...( maskInputOptions || { } ) , password : true } ,
109
110
maskTextFn : maskFn ,
110
111
maskInputFn : maskFn ,
112
+ maskAttributeFn : ( key : string , value : string ) : string => {
113
+ // For now, always mask these attributes
114
+ if ( maskAttributes . includes ( key ) ) {
115
+ return value . replace ( / [ \S ] / g, '*' ) ;
116
+ }
117
+
118
+ return value ;
119
+ } ,
111
120
112
121
...getPrivacyOptions ( {
113
122
mask,
Original file line number Diff line number Diff line change @@ -259,7 +259,12 @@ export interface ReplayIntegrationPrivacyOptions {
259
259
}
260
260
261
261
// These are optional for ReplayPluginOptions because the plugin sets default values
262
- type OptionalReplayPluginOptions = Partial < ReplayPluginOptions > ;
262
+ type OptionalReplayPluginOptions = Partial < ReplayPluginOptions > & {
263
+ /**
264
+ * Mask element attributes that are contained in list
265
+ */
266
+ maskAttributes ?: string [ ] ;
267
+ } ;
263
268
264
269
export interface DeprecatedPrivacyOptions {
265
270
/**
@@ -283,7 +288,7 @@ export interface DeprecatedPrivacyOptions {
283
288
*/
284
289
maskTextClass ?: RecordingOptions [ 'maskTextClass' ] ;
285
290
/**
286
- * @deprecated Use `mask` which accepts an array of CSS selectors
291
+ * @derecated Use `mask` which accepts an array of CSS selectors
287
292
*/
288
293
maskTextSelector ?: RecordingOptions [ 'maskTextSelector' ] ;
289
294
}
You can’t perform that action at this time.
0 commit comments