rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

[Bug]: maskInputFn is ignored during the creation of the full snapshot

Open ababik opened this issue 1 year ago • 0 comments

Preflight Checklist

  • [X] I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.0.0-alpha.11

Expected Behavior

The maskInputFn setting must be applied for masking during the creation of the full snapshot.

Actual Behavior

The maskInputFn setting is ignored.

Steps to Reproduce

  1. Create a simple page that contains an input with some value. E.g.
<body>
    <input type="text" value="some text value">
</body>
  1. Configure recorder to mask all elements except specified in the maskInputFn
maskAllInputs: true,
maskInputFn(value, element) {
  // ... the logic to skip masking for our text input
  return value;
}
  1. Record the page loading and replay events. The initial input's text is masked in the recorded video. The element only gets unmasked if you start editing its value.

Testcase Gist URL

No response

Additional Information

I checked the code and it looks like maskInputFn setting is ignored for the full snapshot creation.

ababik avatar Jan 04 '24 19:01 ababik