rrweb icon indicating copy to clipboard operation
rrweb copied to clipboard

[Bug]: maskInputFn is not called on inputs

Open ericmeadows opened this issue 1 year ago • 2 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-snapshot

Version

v1.1.3

Expected Behavior

I have created a maskInputFn, which should print the element, as well as ignore hidden elements...

Actual Behavior

No console logs appear, and the hidden fields come through, unmasked..

Steps to Reproduce

I have created a maskInputFn, which I would assume would sanitize my inputs, but the data is coming through...

Here's maskInputFn:

  function maskInputFn(text, element) {
    console.log("element", element);
    if (element.type === "hidden") {
      return "";
    }
    // Default to returning the original text
    return text;
  }

Here's the initialization:

rrwebRecord({
  emit(event) {
    console.log("emitting");
    cacheEvents(event);
  },
  maskInputOptions: { maskInputFn },
  maskInputFn
});

Testcase Gist URL

No response

Additional Information

This is extremely important for us to handle...

ericmeadows avatar May 29 '24 18:05 ericmeadows