Skip to content
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(session replay): added ability to change maskTextFn #719

Open
wants to merge 1 commit into
base: v1.x
Choose a base branch
from

Conversation

MYXOMOPX
Copy link

Summary

Allow to change maskTextFn: passes maskTextFn deep down to rrweb

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

@lewgordon-amplitude
Copy link

Hey there! Thanks for the contribution. I'm implementing something related in (#756). I'd be curious if that solves what you're trying to do here?

@MYXOMOPX
Copy link
Author

@lewgordon-amplitude Hi!
Actually my idea was to change maskTextFn and check there CSS variable. If on element css-variable value is 1 (f.e. --amplitude-mask: 1) - then mask text. Else - not.
With this logic we can use amp-mask, amp-unmask classes and only last one will affect element.
So in my example I will be able to do smth like this:

<div class="amp-mask">
    <span>This text is masked</span>
    <div class="amp-unmask">
        This UNmasked
        <span class="amp-mask">Masked</span>
        <input placeholder="Unmasked input"/>
    </div>
</div>

And somewhere in CSS i will place

.amp-mask {
  --amplitude-mask: 1;
}

.amp-unmask {
  --amplitude-mask: 0;
}

Not sure that mask-levels can help in using nested mask/unmask classes. But if you will implement it - i'll be thankful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants