DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
Why not use the hasOwnProperty function to overcome the problems with the in operator?
In practice, this won't change much of the behavior. However, I expect it would be more stable..!! 🙏
Summary
@cure53 👋 Related: https://github.com/cure53/DOMPurify/pull/908
Why not use the
hasOwnProperty
function to overcome the problems with thein
operator? In practice, this won't change much of the behavior. However, I expect it would be more stable..!! 🙏Reference
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in#inherited_properties https://stackoverflow.com/questions/13632999/if-key-in-object-or-ifobject-hasownpropertykey