Skip to content

Replay SDK: Allowlist of elements to not mask #6559

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

Closed
bruno-garcia opened this issue Dec 15, 2022 · 3 comments · Fixed by #6645
Closed

Replay SDK: Allowlist of elements to not mask #6559

bruno-garcia opened this issue Dec 15, 2022 · 3 comments · Fixed by #6645
Assignees
Labels
Package: replay Issues related to the Sentry Replay SDK

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Dec 15, 2022

  1. “Allowlist” nodes/class/selector

    1. Quote 1: For masking text / media, could we get a class that acts as the inverse of the maskTextClass(as seen under [privacy configuration here](https://github.com/getsentry/sentry-replay#privacy-configuration))? Since we’ve decided to mask all text and media in the app, it would be nice to be able to mark some components where we know there will be no PII so it can be shown.

    2. Quote 2*: I really like the way the new Replay feature works, but I wish I could configure the masking the other way around: Instead of telling Sentry what elements need to be masked, I would like to mark elements that can be visible. A simple custom directive eg. "show-in-sentry-replay" would be perfect and could reduce the amount of work I need to do meet our needs*

@bruno-garcia bruno-garcia changed the title Replay SDK: Allowlist of elements to not mask by default Replay SDK: Allowlist of elements to not mask Dec 15, 2022
@ryan953
Copy link
Member

ryan953 commented Dec 15, 2022

I'm tried and failed with something like :not(html, *>*, *:where(* > .nav li a), .nav li to allow the navbar text to be visible, but to mask everything else.

It's difficult ,because you want to * container nodes, like div but then not-mask inner content. So we want the selector to be like * > :not(nav) and skip all parent and child nodes of my target.

To test you can select a note in the inspector and exec $0.matches(...) and $0.closest(...)

See also: #6354

@Lms24 Lms24 added the Package: replay Issues related to the Sentry Replay SDK label Dec 16, 2022
@billyvg billyvg self-assigned this Dec 22, 2022
@Lms24
Copy link
Member

Lms24 commented Jan 3, 2023

This PR partially addresses this issue

We can also update docs to tell users what using not would essentially give them an allowlist of elements that shouldn't be masked.

@github-actions
Copy link
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
4 participants