-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Allow for masking of attributes #1257
base: master
Are you sure you want to change the base?
feat: Allow for masking of attributes #1257
Conversation
🦋 Changeset detectedLatest commit: 7481949 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1baa127
to
b9e2abe
Compare
This currently adds a new API, `maskAttributesFn: (key: string, value: string, element: HTMLElement) => string`, that is used as a callback in `transformAttribute`. I prefer this API as it gives more flexibility for users (though it may need to pass the el node for most flexibility), but it is inconsistent with `maskTextFn` and `maskInputFn`. other options: * Rename this to something else (open to ideas) * Change this to pass value, and dom element (similar to MaskInputFn) to customize masking instead of decision maker of when to mask and introduce a simpler declarative API for what attributes to mask * ???
b9e2abe
to
7481949
Compare
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <[email protected]> Co-authored-by: mdellanoce <[email protected]> Co-authored-by: Yun Feng <[email protected]> Co-authored-by: Francesco Novy <[email protected]> Co-authored-by: Lukas Stracke <[email protected]>
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <[email protected]> Co-authored-by: mdellanoce <[email protected]> Co-authored-by: Yun Feng <[email protected]> Co-authored-by: Francesco Novy <[email protected]> Co-authored-by: Lukas Stracke <[email protected]>
Just wanted to say that it is awesome to see this, we were going to be bringing up attribute masking from Pendo pretty soon anyways 😅 So in your solution you opt for just always calling the Another thought would be if we don't want a list of attributes as an option would it instead be better to just call the |
Brings this library up to date w/ upstream. Includes additional commits for enhanced privacy and Sentry release workflows. Cherry picks include the following upstream PRs: * rrweb-io#1096 * rrweb-io#1155 * rrweb-io#1257 * rrweb-io#1262 Cherry picks from getsentry fork: * #70 * #103 * 064d8c4 * e274f88 * cffefa2 * #20 --------- Co-authored-by: Michael Dellanoce <[email protected]> Co-authored-by: mdellanoce <[email protected]> Co-authored-by: Yun Feng <[email protected]> Co-authored-by: Francesco Novy <[email protected]> Co-authored-by: Lukas Stracke <[email protected]>
Note: this is more of an RFCIdeally this would allow users to be able to mask attributes of DOM nodes. An example of this is
placeholder
which can be a bit suspicious to our users when our default state is that everything is masked.This currently adds a new API,
maskAttributesFn: (key: string, value: string, el: HTMLElement) => string
, that is used as a callback intransformAttribute
. I prefer this API as it gives more flexibility for users (though it may need to pass the el node for most flexibility), but it is a bit inconsistent withmaskTextFn
andmaskInputFn
.other options:
* Rename this to something else (open to ideas)* ???