Ahmad Alfy walks through the new browser-native API that prevents XSS without DOMPurify. Safe methods setHTML and parseHTML always strip dangerous content, while setHTMLUnsafe and parseHTMLUnsafe respect your configuration. Allow-lists and block-lists give fine-grained control over elements and attributes. Great for comment sections, WYSIWYG editors, and markdown previews, though backend sanitization stays essential.
The HTML Sanitizer API
