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

fix: handle undefined Element in DOMPurify initialization #1059

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

yehuya
Copy link

@yehuya yehuya commented Jan 21, 2025

Summary

In some cases, window.Element is undefined. As a result, importing the DOMPurify package causes it to crash immediately due to the const ElementPrototype = Element.prototype; expression in the DOMPurify initialization.

Background & Context

This fix addresses the error that occurs when importing DOMPurify in environments where window.Element is undefined.

Tasks

  • Validate that I didn't break anything.

Dependencies

  • Resolved dependency
  • Open dependency

@cure53
Copy link
Owner

cure53 commented Jan 22, 2025

Oh, this looks great, thank you. This is ready to merge, no?

@cure53 cure53 merged commit 72760ca into cure53:main Jan 22, 2025
8 checks passed
@yehuya yehuya deleted the fixMissingWindowElement branch January 22, 2025 11:33
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