r/javascript • • May 07 '26 • Bravo 1

The HTML Sanitizer API

https://alfy.blog/2026/05/07/html-sanitizer-api.html

I wrote an article about HTML Sanitizer API, a new native API that allows us to sanitize and parse HTML without relying on third party tools like DOMPurify

71 Upvotes

15 comments sorted by

View all comments

Show parent comment

4

u/Hipolipolopigus May 08 '26

Works fine in Chromium browsers, just not documented by MDN's compatibility data.

1

u/senfiaj May 26 '26

https://caniuse.com/mdn-api_element_sethtml,mdn-api_sanitizer
It's supported in most major browsers, Safari is the main one which doesn't support.