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

[Bug]: use blockSelector to mask img record will throw error: e.matches is not a function #1486

Open
1 task done
palinchen opened this issue May 28, 2024 · 3 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@palinchen
Copy link

Preflight Checklist

  • 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.4

Expected Behavior

The el matches is not a function, may happen in some el which it's nodetype not be 1
make a judgment before use.

Actual Behavior

Uncaught TypeError: e.matches is not a function
at Nt (:1:79872)
at Kt.genAdds (:1:89039)
at :1:88018
at NodeList.forEach ()
at Kt.processMutation (:1:88002)
at Array.forEach ()
at Kt.processMutations (:1:83315)

Steps to Reproduce

1、use rrweb record
2、set blockSelector option : img,svg,canvas

Testcase Gist URL

No response

Additional Information

No response

@palinchen palinchen added the bug Something isn't working label May 28, 2024
@palinchen
Copy link
Author

palinchen commented May 28, 2024

el.matches is not function when el is textNode (node type is 3)

@eoghanmurray
Copy link
Contributor

Great catch.

With maskTextSelector we handle this using a function needMaskingText which jumps to the parent node when the node is not an element node.
Are you in a position to create a PR along similar lines?

@benellatalon
Copy link

Also getting this 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants