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(
117117 nodeId : expect . any ( Number ) ,
118118 node : {
119119 attributes : {
120- 'aria-label' : '** ***** ** ********** ' ,
120+ 'aria-label' : 'An Error in aria-label ' ,
121121 class : 'btn btn-error' ,
122122 id : 'error' ,
123123 role : 'button' ,
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export class Replay implements Integration {
7979 networkResponseHeaders = [ ] ,
8080
8181 mask = [ ] ,
82+ maskAttributes = [ 'title' , 'placeholder' ] ,
8283 unmask = [ ] ,
8384 block = [ ] ,
8485 unblock = [ ] ,
@@ -106,6 +107,14 @@ export class Replay implements Integration {
106107 maskInputOptions : { ...( maskInputOptions || { } ) , password : true } ,
107108 maskTextFn : maskFn ,
108109 maskInputFn : maskFn ,
110+ maskAttributeFn : ( key : string , value : string ) : string => {
111+ // For now, always mask these attributes
112+ if ( maskAttributes . includes ( key ) ) {
113+ return value . replace ( / [ \S ] / g, '*' ) ;
114+ }
115+
116+ return value ;
117+ } ,
109118
110119 ...getPrivacyOptions ( {
111120 mask,
Original file line number Diff line number Diff line change @@ -259,7 +259,12 @@ export interface ReplayIntegrationPrivacyOptions {
259259}
260260
261261// 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+ } ;
263268
264269export interface DeprecatedPrivacyOptions {
265270 /**
@@ -283,7 +288,7 @@ export interface DeprecatedPrivacyOptions {
283288 */
284289 maskTextClass ?: RecordingOptions [ 'maskTextClass' ] ;
285290 /**
286- * @deprecated Use `mask` which accepts an array of CSS selectors
291+ * @derecated Use `mask` which accepts an array of CSS selectors
287292 */
288293 maskTextSelector ?: RecordingOptions [ 'maskTextSelector' ] ;
289294}
You can’t perform that action at this time.
0 commit comments