Support HTML Sanitizer API from browser #479
Replies: 1 comment
-
Hi @GeorgeTailor, The Sanitizer API is part of the DOM API more generally. While supporting DOM in Workers could be useful, it would be a massive project. We don't currently have any plans to do this, sorry. For most HTML-oriented uses cases in Workers, HTMLRewriter is actually a better fit. This API allows you to modify HTML in a streaming fashion, which uses less memory and incurs less latency in the Workers context. We don't currently have any sort of sanitization functionality built into HTMLRewriter, but this might be something that could be provided by a library pretty easily, built on top of HTMLRewriter. Point of order: I am going to convert this issue into a discussion. We prefer to reserve issues for immediately-actionable bugs and tasks, not for open-ended feature requests. Discussions are a better place for those. |
Beta Was this translation helpful? Give feedback.
-
https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API
creating a Sanitizer object with
const sanitizer = new Sanitizer();
gives the following error:ReferenceError: Sanitizer is not defined
Beta Was this translation helpful? Give feedback.
All reactions